avoid assigments between unsigned and signed char, MPW does not like these
authorMartin Schaffner <schaffnerb@gmx.ch>
Sun, 1 Aug 2004 16:28:33 +0000 (16:28 +0000)
committerMartin Schaffner <schaffnerb@gmx.ch>
Sun, 1 Aug 2004 16:28:33 +0000 (16:28 +0000)
14 files changed:
2d/bitblt.c
2d/font.c
2d/rle.c
ChangeLog
arch/ogl/gr.c
iff/iff.c
main/inferno.c
main/kconfig.c
main/movie.c
main/multi.c
main/multibot.c
main/netmisc.c
main/newdemo.c
mem/mem.c

index ee8c4c5..0818d3f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitblt.c,v 1.13 2003-12-08 21:21:16 btb Exp $ */
+/* $Id: bitblt.c,v 1.14 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -2112,11 +2112,11 @@ void gr_bm_ubitbltm(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * s
 
 // rescalling bitmaps, 10/14/99 Jan Bobrowski jb@wizard.ae.krakow.pl
 
-inline void scale_line(sbyte *in, sbyte *out, int ilen, int olen)
+inline void scale_line(unsigned char *in, unsigned char *out, int ilen, int olen)
 {
        int a = olen/ilen, b = olen%ilen;
        int c = 0, i;
-       sbyte *end = out + olen;
+       unsigned char *end = out + olen;
        while(out<end) {
                i = a;
                c += b;
@@ -2134,8 +2134,8 @@ inline void scale_line(sbyte *in, sbyte *out, int ilen, int olen)
 
 void gr_bitmap_scale_to(grs_bitmap *src, grs_bitmap *dst)
 {
-       sbyte *s = src->bm_data;
-       sbyte *d = dst->bm_data;
+       unsigned char *s = src->bm_data;
+       unsigned char *d = dst->bm_data;
        int h = src->bm_h;
        int a = dst->bm_h/h, b = dst->bm_h%h;
        int c = 0, i, y;
index daf211d..5c07141 100644 (file)
--- a/2d/font.c
+++ b/2d/font.c
@@ -1,4 +1,4 @@
-/* $Id: font.c,v 1.30 2004-08-01 13:01:39 schaffner Exp $ */
+/* $Id: font.c,v 1.31 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -177,7 +177,7 @@ int gr_message_color_level=1;
 int gr_internal_string0(int x, int y, char *s )
 {
        unsigned char * fp;
-       ubyte * text_ptr, * next_row, * text_ptr1;
+       char * text_ptr, * next_row, * text_ptr1;
        int r, BitMask, i, bits, width, spacing, letter, underline;
        int     skip_lines = 0;
 
@@ -291,7 +291,7 @@ int gr_internal_string0(int x, int y, char *s )
 int gr_internal_string0m(int x, int y, char *s )
 {
        unsigned char * fp;
-       ubyte * text_ptr, * next_row, * text_ptr1;
+       char * text_ptr, * next_row, * text_ptr1;
        int r, BitMask, i, bits, width, spacing, letter, underline;
        int     skip_lines = 0;
 
@@ -1199,9 +1199,9 @@ void ogl_init_font(grs_font * font){
        int oglflags = OGL_FLAG_ALPHA;
        int     nchars = font->ft_maxchar-font->ft_minchar+1;
        int i,w,h,tw,th,x,y,curx=0,cury=0;
-       char *fp;
+       unsigned char *fp;
        //      char data[32*32*4];
-       char *data;
+       ubyte *data;
        int gap=0;//having a gap just wastes ram, since we don't filter text textures at all.
        //      char s[2];
        ogl_font_choose_size(font,gap,&tw,&th);
@@ -1282,7 +1282,7 @@ void ogl_init_font(grs_font * font){
 
 int ogl_internal_string(int x, int y, char *s )
 {
-       ubyte * text_ptr, * next_row, * text_ptr1;
+       char * text_ptr, * next_row, * text_ptr1;
        int width, spacing,letter;
        int xx,yy;
        int orig_color=FG_COLOR;//to allow easy reseting to default string color with colored strings -MPM
@@ -1660,7 +1660,7 @@ grs_font * gr_init_font( char * fontname )
        if (font->ft_flags & FT_PROPORTIONAL) {
 
                font->ft_widths = (short *) &font_data[(int)font->ft_widths];
-               font->ft_data = &font_data[(int)font->ft_data];
+               font->ft_data = (unsigned char *) &font_data[(int)font->ft_data];
                font->ft_chars = (unsigned char **)d_malloc( nchars * sizeof(unsigned char *));
 
                ptr = font->ft_data;
@@ -1676,7 +1676,7 @@ grs_font * gr_init_font( char * fontname )
 
        } else  {
 
-               font->ft_data   = font_data;
+               font->ft_data   = (unsigned char *) font_data;
                font->ft_chars  = NULL;
                font->ft_widths = NULL;
 
@@ -1684,7 +1684,7 @@ grs_font * gr_init_font( char * fontname )
        }
 
        if (font->ft_flags & FT_KERNED)
-               font->ft_kerndata = &font_data[(int)font->ft_kerndata];
+               font->ft_kerndata = (unsigned char *) &font_data[(int)font->ft_kerndata];
 
        if (font->ft_flags & FT_COLOR) {                //remap palette
                ubyte palette[256*3];
@@ -1787,7 +1787,7 @@ void gr_remap_font( grs_font *font, char * fontname, char *font_data )
        if (font->ft_flags & FT_PROPORTIONAL) {
 
                font->ft_widths = (short *) &font_data[(int)font->ft_widths];
-               font->ft_data = &font_data[(int)font->ft_data];
+               font->ft_data = (unsigned char *) &font_data[(int)font->ft_data];
                font->ft_chars = (unsigned char **)d_malloc( nchars * sizeof(unsigned char *));
 
                ptr = font->ft_data;
@@ -1803,7 +1803,7 @@ void gr_remap_font( grs_font *font, char * fontname, char *font_data )
 
        } else  {
 
-               font->ft_data   = font_data;
+               font->ft_data   = (unsigned char *) font_data;
                font->ft_chars  = NULL;
                font->ft_widths = NULL;
 
@@ -1811,7 +1811,7 @@ void gr_remap_font( grs_font *font, char * fontname, char *font_data )
        }
 
        if (font->ft_flags & FT_KERNED)
-               font->ft_kerndata = &font_data[(int)font->ft_kerndata];
+               font->ft_kerndata = (unsigned char *) &font_data[(int)font->ft_kerndata];
 
        if (font->ft_flags & FT_COLOR) {                //remap palette
                ubyte palette[256*3];
index 7723729..49b3584 100644 (file)
--- a/2d/rle.c
+++ b/2d/rle.c
@@ -1,4 +1,4 @@
-/* $Id: rle.c,v 1.17 2004-01-08 20:31:35 schaffner Exp $ */
+/* $Id: rle.c,v 1.18 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -125,7 +125,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: rle.c,v 1.17 2004-01-08 20:31:35 schaffner Exp $";
+static char rcsid[] = "$Id: rle.c,v 1.18 2004-08-01 16:28:33 schaffner Exp $";
 #endif
 
 #include <stdlib.h>
@@ -312,7 +312,7 @@ void gr_rle_decode( ubyte * src, ubyte * dest )
 
 #endif
 
-void rle_stosb(char *dest, int len, int color);
+void rle_stosb (unsigned char *dest, int len, int color);
 
 #if !defined(NO_ASM) && defined(__WATCOMC__)
 
@@ -320,7 +320,7 @@ void rle_stosb(char *dest, int len, int color);
 
 #elif !defined(NO_ASM) && defined(__GNUC__)
 
-inline void rle_stosb(char *dest, int len, int color) {
+inline void rle_stosb (unsigned char *dest, int len, int color) {
        int dummy[2];
    __asm__ __volatile__ (
     "cld; rep; stosb"
@@ -330,7 +330,7 @@ inline void rle_stosb(char *dest, int len, int color) {
 
 #elif !defined(NO_ASM) && defined(_MSC_VER)
 
-__inline void rle_stosb(char *dest, int len, int color)
+__inline void rle_stosb (unsigned char *dest, int len, int color)
 {
   __asm {
        mov edi,[dest]
@@ -343,7 +343,7 @@ __inline void rle_stosb(char *dest, int len, int color)
 
 #else // NO_ASM or unknown compiler
 
-void rle_stosb(char *dest, int len, int color)
+void rle_stosb (unsigned char *dest, int len, int color)
 {
        int i;
        for (i=0; i<len; i++ )
index f47b4e1..37a0a60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * cfile/cfile.c: use portable ffilelength in cfile_size
 
+       * 2d/bitblt.c, 2d/font.c, 2d/rle.c, arch/ogl/gr.c, iff/iff.c,
+       main/inferno.c, main/kconfig.c, main/multi.c, main/multibot.c,
+       main/netmisc.c, main/newdemo.c, mem/mem.c: avoid assigments between
+       unsigned and signed char, MPW does not like these
+
 2004-06-26  Chris Taylor  <c.taylor@student.curtin.edu.au>
 
        * main/gamemine.c, main/gamemine.h, main/gamesave.c: remove some
index 155ca99..eddd31b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gr.c,v 1.33 2004-08-01 14:22:54 schaffner Exp $ */
+/* $Id: gr.c,v 1.34 2004-08-01 16:28:33 schaffner Exp $ */
 /*
  *
  * OGL video functions. - Added 9/15/99 Matthew Mueller
@@ -156,7 +156,7 @@ void gr_update()
        }
 }
 
-const char *gl_vendor,*gl_renderer,*gl_version,*gl_extensions;
+const char *gl_vendor, *gl_renderer, *gl_version, *gl_extensions;
 
 void ogl_get_verinfo(void)
 {
@@ -166,10 +166,10 @@ void ogl_get_verinfo(void)
 #endif
        float anisotropic_max = 0;
 
-       gl_vendor=glGetString(GL_VENDOR);
-       gl_renderer=glGetString(GL_RENDERER);
-       gl_version=glGetString(GL_VERSION);
-       gl_extensions=glGetString(GL_EXTENSIONS);
+       gl_vendor = (const char *) glGetString (GL_VENDOR);
+       gl_renderer = (const char *) glGetString (GL_RENDERER);
+       gl_version = (const char *) glGetString (GL_VERSION);
+       gl_extensions = (const char *) glGetString (GL_EXTENSIONS);
 
        con_printf(CON_VERBOSE, "gl vendor:%s renderer:%s version:%s extensions:%s\n",gl_vendor,gl_renderer,gl_version,gl_extensions);
 
index 698a4c5..19dfdd9 100644 (file)
--- a/iff/iff.c
+++ b/iff/iff.c
@@ -1,4 +1,4 @@
-/* $Id: iff.c,v 1.7 2003-10-04 03:14:47 btb Exp $ */
+/* $Id: iff.c,v 1.8 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -168,7 +168,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: iff.c,v 1.7 2003-10-04 03:14:47 btb Exp $";
+static char rcsid[] = "$Id: iff.c,v 1.8 2004-08-01 16:28:33 schaffner Exp $";
 #endif
 
 #define COMPRESS               1       //do the RLE or not? (for debugging mostly)
@@ -770,7 +770,7 @@ int convert_ilbm_to_pbm(iff_bitmap_header *bmheader)
 
        for (y=0;y<bmheader->h;y++) {
 
-               rowptr = &bmheader->raw_data[y * bytes_per_row * bmheader->nplanes];
+               rowptr = (signed char *) &bmheader->raw_data[y * bytes_per_row * bmheader->nplanes];
 
                for (x=0,checkmask=0x80;x<bmheader->w;x++) {
 
@@ -792,7 +792,7 @@ int convert_ilbm_to_pbm(iff_bitmap_header *bmheader)
        }
 
        d_free(bmheader->raw_data);
-       bmheader->raw_data = new_data;
+       bmheader->raw_data = (unsigned char *) new_data;
 
        bmheader->type = TYPE_PBM;
 
@@ -971,7 +971,7 @@ int iff_read_bitmap(char *ifilename,grs_bitmap *bm,int bitmap_type,ubyte *palett
        ret = open_fake_file(ifilename,&ifile);         //read in entire file
        if (ret == IFF_NO_ERROR) {
                bm->bm_data = NULL;
-               ret = iff_parse_bitmap(&ifile,bm,bitmap_type,palette,NULL);
+               ret = iff_parse_bitmap(&ifile,bm,bitmap_type,(signed char *) palette,NULL);
        }
 
        if (ifile.data) d_free(ifile.data);
@@ -1353,7 +1353,7 @@ int iff_read_animbrush(char *ifilename,grs_bitmap **bm_list,int max_bitmaps,int
                        MALLOC(bm_list[*n_bitmaps] , grs_bitmap, 1 );
                        bm_list[*n_bitmaps]->bm_data = NULL;
 
-                       ret = iff_parse_bitmap(&ifile,bm_list[*n_bitmaps],form_type,*n_bitmaps>0?NULL:palette,prev_bm);
+                       ret = iff_parse_bitmap(&ifile,bm_list[*n_bitmaps],form_type,*n_bitmaps>0?NULL:(signed char *)palette,prev_bm);
 
                        if (ret != IFF_NO_ERROR)
                                goto done;
index f725952..e0573d6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: inferno.c,v 1.85 2004-05-22 22:43:56 btb Exp $ */
+/* $Id: inferno.c,v 1.86 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -1824,7 +1824,7 @@ void show_order_form()
 #ifndef EDITOR
 
        int pcx_error;
-       char title_pal[768];
+       unsigned char title_pal[768];
        char    exit_screen[16];
 
        gr_set_current_canvas( NULL );
index 9ff81f6..1aeeac5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: kconfig.c,v 1.30 2004-05-22 07:27:29 btb Exp $ */
+/* $Id: kconfig.c,v 1.31 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -346,7 +346,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: kconfig.c,v 1.30 2004-05-22 07:27:29 btb Exp $";
+static char rcsid[] = "$Id: kconfig.c,v 1.31 2004-08-01 16:28:33 schaffner Exp $";
 #endif
 
 #ifdef WINDOWS
@@ -2434,11 +2434,11 @@ fix     joy_axis[JOY_NUM_AXES];
 #endif
 
 ubyte                  kc_use_external_control = 0;
-ubyte                          kc_enable_external_control = 0;
+ubyte                  kc_enable_external_control = 0;
 ubyte                  kc_external_intno = 0;
 ext_control_info       *kc_external_control = NULL;
-ubyte                          *kc_external_name = NULL;
-ubyte                          kc_external_version = 0;
+char                   *kc_external_name = NULL;
+ubyte                  kc_external_version = 0;
 extern int Automap_active;
 
 void kconfig_init_external_controls(int intno, int address)
index cdf9708..167ab7e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: movie.c,v 1.34 2004-08-01 13:01:39 schaffner Exp $ */
+/* $Id: movie.c,v 1.35 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -23,7 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: movie.c,v 1.34 2004-08-01 13:01:39 schaffner Exp $";
+static char rcsid[] = "$Id: movie.c,v 1.35 2004-08-01 16:28:33 schaffner Exp $";
 #endif
 
 #define DEBUG_LEVEL CON_NORMAL
@@ -318,7 +318,7 @@ int RunMovie(char *filename, int hires_flag, int must_have,int dx,int dy)
        int frame_num;
        int key;
 #ifdef OGL
-       char pal_save[768];
+       ubyte pal_save[768];
 #endif
 
        result=1;
@@ -499,11 +499,11 @@ int InitRobotMovie(char *filename)
  *             Subtitle system code
  */
 
-ubyte *subtitle_raw_data;
+char *subtitle_raw_data;
 
 
 //search for next field following whitespace 
-ubyte *next_field(ubyte *p)
+char *next_field (char *p)
 {
        while (*p && !isspace(*p))
                p++;
@@ -525,7 +525,7 @@ int init_subtitles(char *filename)
 {
        CFILE *ifile;
        int size,read_count;
-       ubyte *p;
+       char *p;
        int have_binary = 0;
 
        Num_subtitles = 0;
index bcb81ba..3e8df49 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: multi.c,v 1.15 2004-04-22 21:07:32 btb Exp $ */
+/* $Id: multi.c,v 1.16 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -952,7 +952,7 @@ multi_send_data(char *buf, int len, int repeat)
        if ((Game_mode & GM_SERIAL) || (Game_mode & GM_MODEM))
                com_send_data(buf, len, repeat);
        else if (Game_mode & GM_NETWORK)
-               network_send_data(buf, len, repeat);
+               network_send_data((unsigned char *)buf, len, repeat);
 }
 
 void
@@ -2325,7 +2325,7 @@ void multi_do_req_player(char *buf)
                extract_netplayer_stats( &ps, &Players[Player_num] );
                ps.Player_num = Player_num;
                ps.message_type = MULTI_SEND_PLAYER;            // SET
-               multi_send_data((ubyte*)&ps, sizeof(netplayer_stats), 0);
+               multi_send_data((char*)&ps, sizeof(netplayer_stats), 0);
        }
 }
 
index 8fc0567..702f783 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: multibot.c,v 1.6 2004-04-22 21:07:32 btb Exp $ */
+/* $Id: multibot.c,v 1.7 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -433,7 +433,7 @@ multi_send_robot_frame(int sent)
                        if (robot_fired[sending])
                        {
                                robot_fired[sending] = 0;
-                               multi_send_data(robot_fire_buf[sending], 18, 1);
+                               multi_send_data((char *)robot_fire_buf[sending], 18, 1);
                        }
 
                        if (!(Game_mode & GM_NETWORK))
index 666b266..9019f06 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: netmisc.c,v 1.9 2003-10-04 19:13:32 btb Exp $ */
+/* $Id: netmisc.c,v 1.10 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -41,7 +41,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
 #endif
 
 #ifdef RCS
-static char rcsid[] = "$Id: netmisc.c,v 1.9 2003-10-04 19:13:32 btb Exp $";
+static char rcsid[] = "$Id: netmisc.c,v 1.10 2004-08-01 16:28:33 schaffner Exp $";
 #endif
 
 #include <stdio.h>
@@ -80,7 +80,7 @@ ushort mac_calc_segment_checksum()
        sum1 = sum2 = 0;
        for (i = 0; i < Highest_segment_index + 1; i++) {
                for (j = 0; j < MAX_SIDES_PER_SEGMENT; j++) {
-                       mac_do_checksum_calc(&(Segments[i].sides[j].type), 1, &sum1, &sum2);
+                       mac_do_checksum_calc((unsigned char *)&(Segments[i].sides[j].type), 1, &sum1, &sum2);
                        mac_do_checksum_calc(&(Segments[i].sides[j].pad), 1, &sum1, &sum2);
                        s = INTEL_SHORT(Segments[i].sides[j].wall_num);
                        mac_do_checksum_calc((ubyte *)&s, 2, &sum1, &sum2);
@@ -186,9 +186,9 @@ void send_netplayers_packet(ubyte *server, ubyte *node)
        }
 
        if ((server == NULL) && (node == NULL))
-               ipx_send_broadcast_packet_data(out_buffer, loc);
+               ipx_send_broadcast_packet_data((unsigned char *)out_buffer, loc);
        else
-               ipx_send_internetwork_packet_data(out_buffer, loc, server, node);
+               ipx_send_internetwork_packet_data((unsigned char *)out_buffer, loc, server, node);
 
 }
 
@@ -226,11 +226,11 @@ void send_sequence_packet(sequence_packet seq, ubyte *server, ubyte *node, ubyte
        memcpy(&(out_buffer[loc]), &tmps, 2);                           loc += 2;
        out_buffer[loc]=seq.player.rank;                                loc++;      // for pad byte
        if (net_address != NULL)
-               ipx_send_packet_data(out_buffer, loc, server, node, net_address);
+               ipx_send_packet_data((unsigned char *)out_buffer, loc, server, node, net_address);
        else if ((server == NULL) && (node == NULL))
-               ipx_send_broadcast_packet_data(out_buffer, loc);
+               ipx_send_broadcast_packet_data((unsigned char *)out_buffer, loc);
        else
-               ipx_send_internetwork_packet_data(out_buffer, loc, server, node);
+               ipx_send_internetwork_packet_data((unsigned char *)out_buffer, loc, server, node);
 }
 
 void receive_sequence_packet(ubyte *data, sequence_packet *seq)
@@ -358,11 +358,11 @@ void send_netgame_packet(ubyte *server, ubyte *node, ubyte *net_address, int lit
 
 do_send:
        if (net_address != NULL)
-               ipx_send_packet_data(out_buffer, loc, server, node, net_address);
+               ipx_send_packet_data((unsigned char *)out_buffer, loc, server, node, net_address);
        else if ((server == NULL) && (node == NULL))
-               ipx_send_broadcast_packet_data(out_buffer, loc);
+               ipx_send_broadcast_packet_data((unsigned char *)out_buffer, loc);
        else
-               ipx_send_internetwork_packet_data(out_buffer, loc, server, node);
+               ipx_send_internetwork_packet_data((unsigned char *)out_buffer, loc, server, node);
 }
 
 void receive_netgame_packet(ubyte *data, netgame_info *netgame, int lite_flag)
index 1b8cc14..f084cd2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: newdemo.c,v 1.15 2003-11-26 12:26:31 btb Exp $ */
+/* $Id: newdemo.c,v 1.16 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -1171,13 +1171,13 @@ void nd_read_object(object *obj)
         * Do render type first, since with render_type == RT_NONE, we
         * blow by all other object information
         */
-       nd_read_byte(&(obj->render_type));
-       nd_read_byte(&(obj->type));
+       nd_read_byte((sbyte *) &(obj->render_type));
+       nd_read_byte((sbyte *) &(obj->type));
        if ((obj->render_type == RT_NONE) && (obj->type != OBJ_CAMERA))
                return;
 
-       nd_read_byte(&(obj->id));
-       nd_read_byte(&(obj->flags));
+       nd_read_byte((sbyte *) &(obj->id));
+       nd_read_byte((sbyte *) &(obj->flags));
        nd_read_short((short *)&(obj->signature));
        nd_read_shortpos(obj);
 
@@ -1210,7 +1210,7 @@ void nd_read_object(object *obj)
 
        case OBJ_POWERUP:
                obj->control_type = CT_POWERUP;
-               nd_read_byte(&(obj->movement_type));        // might have physics movement
+               nd_read_byte((sbyte *) &(obj->movement_type));        // might have physics movement
                obj->size = Powerup_info[obj->id].size;
                break;
 
@@ -1231,8 +1231,8 @@ void nd_read_object(object *obj)
                break;
 
        default:
-               nd_read_byte(&(obj->control_type));
-               nd_read_byte(&(obj->movement_type));
+               nd_read_byte((sbyte *) &(obj->control_type));
+               nd_read_byte((sbyte *) &(obj->movement_type));
                nd_read_fix(&(obj->size));
                break;
        }
@@ -1242,7 +1242,7 @@ void nd_read_object(object *obj)
        if ((obj->type == OBJ_WEAPON) && (obj->render_type == RT_WEAPON_VCLIP))
                nd_read_fix(&(obj->lifeleft));
        else {
-               ubyte b;
+               sbyte b;
 
                nd_read_byte(&b);
                obj->lifeleft = (fix)b;
@@ -2135,7 +2135,7 @@ void newdemo_set_new_level(int level_num)
 int newdemo_read_demo_start(int rnd_demo)
 {
        sbyte i, version, game_type, laser_level;
-       char c, energy, shield;
+       sbyte c, energy, shield;
        char text[128], current_mission[9];
 
        nd_read_byte(&c);
@@ -2302,7 +2302,7 @@ int newdemo_read_frame_information()
 {
        int done, segnum, side, objnum, soundno, angle, volume, i,shot;
        object *obj;
-       ubyte c,WhichWindow;
+       sbyte c,WhichWindow;
        static sbyte saved_letter_cockpit;
        static sbyte saved_rearview_cockpit;
        object extraobj;
@@ -2601,8 +2601,8 @@ int newdemo_read_frame_information()
                }
 
                case ND_EVENT_PLAYER_ENERGY: {
-                       ubyte energy;
-                       ubyte old_energy;
+                       sbyte energy;
+                       sbyte old_energy;
 
                        nd_read_byte(&old_energy);
                        nd_read_byte(&energy);
@@ -2610,15 +2610,15 @@ int newdemo_read_frame_information()
                        if ((Newdemo_vcr_state == ND_STATE_PLAYBACK) || (Newdemo_vcr_state == ND_STATE_FASTFORWARD) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEFORWARD)) {
                                Players[Player_num].energy = i2f(energy);
                        } else if ((Newdemo_vcr_state == ND_STATE_REWINDING) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEBACKWARD)) {
-                               if (old_energy != 255)
+                               if (old_energy != -128)
                                        Players[Player_num].energy = i2f(old_energy);
                        }
                        break;
                }
 
                case ND_EVENT_PLAYER_AFTERBURNER: {
-                       ubyte afterburner;
-                       ubyte old_afterburner;
+                       sbyte afterburner;
+                       sbyte old_afterburner;
 
                        nd_read_byte(&old_afterburner);
                        nd_read_byte(&afterburner);
@@ -2626,15 +2626,15 @@ int newdemo_read_frame_information()
                        if ((Newdemo_vcr_state == ND_STATE_PLAYBACK) || (Newdemo_vcr_state == ND_STATE_FASTFORWARD) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEFORWARD)) {
                                Afterburner_charge = afterburner<<9;
                        } else if ((Newdemo_vcr_state == ND_STATE_REWINDING) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEBACKWARD)) {
-                               if (old_afterburner != 255)
+                               if (old_afterburner != -128)
                                        Afterburner_charge = old_afterburner<<9;
                        }
                        break;
                }
 
                case ND_EVENT_PLAYER_SHIELD: {
-                       ubyte shield;
-                       ubyte old_shield;
+                       sbyte shield;
+                       sbyte old_shield;
 
                        nd_read_byte(&old_shield);
                        nd_read_byte(&shield);
@@ -2642,7 +2642,7 @@ int newdemo_read_frame_information()
                        if ((Newdemo_vcr_state == ND_STATE_PLAYBACK) || (Newdemo_vcr_state == ND_STATE_FASTFORWARD) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEFORWARD)) {
                                Players[Player_num].shields = i2f(shield);
                        } else if ((Newdemo_vcr_state == ND_STATE_REWINDING) || (Newdemo_vcr_state == ND_STATE_ONEFRAMEBACKWARD)) {
-                               if (old_shield != 255)
+                               if (old_shield != -128)
                                        Players[Player_num].shields = i2f(old_shield);
                        }
                        break;
@@ -2793,7 +2793,7 @@ int newdemo_read_frame_information()
 
                case ND_EVENT_WALL_SET_TMAP_NUM1: {
                        short seg, cseg, tmap;
-                       ubyte side,cside;
+                       sbyte side,cside;
 
                        nd_read_short(&seg);
                        nd_read_byte(&side);
@@ -2807,7 +2807,7 @@ int newdemo_read_frame_information()
 
                case ND_EVENT_WALL_SET_TMAP_NUM2: {
                        short seg, cseg, tmap;
-                       ubyte side,cside;
+                       sbyte side,cside;
 
                        nd_read_short(&seg);
                        nd_read_byte(&side);
@@ -3037,7 +3037,7 @@ int newdemo_read_frame_information()
                }
 
                case ND_EVENT_CLOAKING_WALL: {
-                       ubyte back_wall_num,front_wall_num,type,state,cloak_value;
+                       sbyte back_wall_num,front_wall_num,type,state,cloak_value;
                        short l0,l1,l2,l3;
                        segment *segp;
                        int sidenum;
@@ -3111,9 +3111,9 @@ int newdemo_read_frame_information()
                                nd_read_int (&Num_walls);
                                for (i=0;i<Num_walls;i++)    // restore the walls
                                {
-                                       nd_read_byte (&Walls[i].type);
-                                       nd_read_byte (&Walls[i].flags);
-                                       nd_read_byte (&Walls[i].state);
+                                       nd_read_byte ((signed char *)&Walls[i].type);
+                                       nd_read_byte ((signed char *)&Walls[i].flags);
+                                       nd_read_byte ((signed char *)&Walls[i].state);
 
                                        seg = &Segments[Walls[i].segnum];
                                        side = Walls[i].sidenum;
@@ -3197,7 +3197,7 @@ void newdemo_goto_end()
 {
        short frame_length, byte_count, bshort;
        sbyte level, bbyte, laser_level;
-       ubyte energy, shield, c;
+       sbyte energy, shield, c;
        int i, loc, bint;
 
        cfseek(infile, -2, SEEK_END);
@@ -3349,7 +3349,7 @@ void interpolate_frame(fix d_play, fix d_recorded)
        for (i = 0; i <= num_cur_objs; i++) {
                for (j = 0; j <= Highest_object_index; j++) {
                        if (cur_objs[i].signature == Objects[j].signature) {
-                               ubyte render_type = cur_objs[i].render_type;
+                               sbyte render_type = cur_objs[i].render_type;
                                //fix delta_p, delta_h, delta_b;
                                fix delta_x, delta_y, delta_z;
                                //vms_angvec cur_angles, dest_angles;
@@ -3697,8 +3697,8 @@ void newdemo_stop_recording()
        newmenu_item m[6];
        int l, exit;
        static char filename[15] = "", *s;
-       static ubyte tmpcnt = 0;
-       ubyte cloaked = 0;
+       static sbyte tmpcnt = 0;
+       sbyte cloaked = 0;
        char fullname[15+FILENAME_LEN] = DEMO_DIR;
        unsigned short byte_count = 0;
 
index 04b94cf..884db4e 100644 (file)
--- a/mem/mem.c
+++ b/mem/mem.c
@@ -1,4 +1,4 @@
-/* $Id: mem.c,v 1.13 2004-08-01 13:01:39 schaffner Exp $ */
+/* $Id: mem.c,v 1.14 2004-08-01 16:28:33 schaffner Exp $ */
 /*
 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
@@ -278,7 +278,7 @@ int mem_check_integrity( int block_number )
        int i, ErrorCount;
        ubyte * CheckData;
 
-       CheckData = (char *)((char *)MallocBase[block_number] + MallocSize[block_number]);
+       CheckData = (ubyte *)((char *)MallocBase[block_number] + MallocSize[block_number]);
 
        ErrorCount = 0;