shithub: duke3d

Download patch

ref: 2de110a4439d1f327d872b137b5bfcbf41c8cf56
parent: 7ffae16ab7bf670b6e0480c52b2f91eed291a26f
author: Fabien Sanglard <[email protected]>
date: Thu Dec 13 13:48:53 EST 2012

Removed 'signed char' for int8_t

--- a/Engine/src/build.h
+++ b/Engine/src/build.h
@@ -69,10 +69,10 @@
 	int32_t ceilingz, floorz;
 	short ceilingstat, floorstat;
 	short ceilingpicnum, ceilingheinum;
-	signed char ceilingshade;
+	int8_t ceilingshade;
 	uint8_t  ceilingpal, ceilingxpanning, ceilingypanning;
 	short floorpicnum, floorheinum;
-	signed char floorshade;
+	int8_t floorshade;
 	uint8_t  floorpal, floorxpanning, floorypanning;
 	uint8_t  visibility, filler;
 	short lotag, hitag, extra;
@@ -99,7 +99,7 @@
 	int32_t x, y;
 	short point2, nextwall, nextsector, cstat;
 	short picnum, overpicnum;
-	signed char shade;
+	int8_t shade;
 	char pal, xrepeat, yrepeat, xpanning, ypanning;
 	short lotag, hitag, extra;
 } walltype;
@@ -127,10 +127,10 @@
 {
 	int32_t x, y, z;
 	short cstat, picnum;
-	signed char shade;
+	int8_t shade;
 	uint8_t  pal, clipdist, filler;
 	uint8_t  xrepeat, yrepeat;
-	signed char xoffset, yoffset;
+	int8_t xoffset, yoffset;
 	short sectnum, statnum;
 	short ang, owner, xvel, yvel, zvel;
 	short lotag, hitag, extra;
--- a/Engine/src/enet/include/types.h
+++ b/Engine/src/enet/include/types.h
@@ -5,7 +5,9 @@
 #ifndef __ENET_TYPES_H__
 #define __ENET_TYPES_H__
 
-typedef unsigned char enet_uint8;       /**< unsigned 8-bit type  */
+#include <inttypes.h>
+
+typedef uint8_t enet_uint8;       /**< unsigned 8-bit type  */
 typedef unsigned short enet_uint16;     /**< unsigned 16-bit type */
 typedef unsigned int enet_uint32;      /**< unsigned 32-bit type */
 
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -260,7 +260,7 @@
 {
 	int32_t sx, sy, z;
 	short a, picnum;
-	signed char dashade;
+	int8_t dashade;
 	uint8_t  dapalnum, dastat, pagesleft;
 	int32_t cx1, cy1, cx2, cy2;
 } permfifotype;
@@ -3140,7 +3140,7 @@
 
 
 static void dorotatesprite (int32_t sx, int32_t sy, int32_t z, short a, short picnum,
-	signed char dashade, uint8_t  dapalnum, char dastat, int32_t cx1,
+	int8_t dashade, uint8_t  dapalnum, char dastat, int32_t cx1,
 	int32_t cy1, int32_t cx2, int32_t cy2)
 {
 	int32_t cosang, sinang, v, nextv, dax1, dax2, oy, bx, by, ny1, ny2;
@@ -4183,7 +4183,7 @@
 #ifdef SUPERBUILD
 static void drawvox(int32_t dasprx, int32_t daspry, int32_t dasprz, int32_t dasprang,
 		  int32_t daxscale, int32_t dayscale, uint8_t  daindex,
-		  signed char dashade, uint8_t  dapal, int32_t *daumost, int32_t *dadmost)
+		  int8_t dashade, uint8_t  dapal, int32_t *daumost, int32_t *dadmost)
 {
 	int32_t i, j, k, x, y, syoff, ggxstart, ggystart, nxoff;
 	int32_t cosang, sinang, sprcosang, sprsinang, backx, backy, gxinc, gyinc;
@@ -7431,7 +7431,7 @@
 
 
 void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum,
-                  signed char dashade, char dapalnum, char dastat,
+                  int8_t dashade, char dapalnum, char dastat,
                   int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2)
 {
 	int32_t i;
@@ -7551,8 +7551,8 @@
 }
 
 
-void makepalookup(int32_t palnum, char *remapbuf, signed char r,
-                  signed char g, signed char b, char dastat)
+void makepalookup(int32_t palnum, char *remapbuf, int8_t r,
+                  int8_t g, int8_t b, char dastat)
 {
 	int32_t i, j, dist, palscale;
 	char *ptr, *ptr2;
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -131,10 +131,10 @@
 #endif
 void flushperms(void);
 void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum,
-                  signed char dashade, char dapalnum, char dastat,
+                  int8_t dashade, char dapalnum, char dastat,
                   int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
-void makepalookup(int32_t palnum, char *remapbuf, signed char r,
-                  signed char g, signed char b, char dastat);
+void makepalookup(int32_t palnum, char *remapbuf, int8_t r,
+                  int8_t g, int8_t b, char dastat);
 void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang);
 void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
 void setviewtotile(short tilenume, int32_t xsiz, int32_t ysiz);
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -39,7 +39,7 @@
 extern void keyhandler(void);
 extern void initlava(void);
 extern void movelava(char *dapic);
-extern void drawtilebackground(int32_t thex, int32_t they, short tilenum, signed char shade, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2, char dapalnum);
+extern void drawtilebackground(int32_t thex, int32_t they, short tilenum, int8_t shade, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2, char dapalnum);
 extern void printext(int32_t x, int32_t y, char *buffer, short tilenum, char invisiblecol);
 extern void drawstatusflytime(short snum);
 extern void drawstatusbar(short snum);
@@ -240,8 +240,8 @@
 extern void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
 extern void setaspect(int32_t daxrange, int32_t daaspect);
 extern void flushperms(void);
-extern void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum, signed char dashade, char dapalnum, char dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
-extern void makepalookup(int32_t palnum, char *remapbuf, signed char r, signed char g, signed char b, char dastat);
+extern void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum, int8_t dashade, char dapalnum, char dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
+extern void makepalookup(int32_t palnum, char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat);
 extern void setbrightness(char dabrightness, uint8_t  *dapal);
 extern void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang);
 extern void clearview(int32_t dacol);
--- a/Engine/src/sdl_driver.c
+++ b/Engine/src/sdl_driver.c
@@ -331,7 +331,7 @@
 
 SDL_Surface *surface = NULL; /* This isn't static so that we can use it elsewhere AH */
 static int debug_hall_of_mirrors = 0;
-static Uint32 sdl_flags = SDL_HWPALETTE;
+static uint32_t sdl_flags = SDL_HWPALETTE;
 static int32_t mouse_relative_x = 0;
 static int32_t mouse_relative_y = 0;
 static short mouse_buttons = 0;
@@ -339,14 +339,14 @@
 /* so we can make use of setcolor16()... - DDOI */
 static uint8_t  drawpixel_color=0;
 
-static unsigned int scancodes[SDLK_LAST];
+static uint32_t scancodes[SDLK_LAST];
 
 static int32_t last_render_ticks = 0;
 int32_t total_render_time = 1;
 int32_t total_rendered_frames = 0;
 
-static char *title = NULL;
-static char *titleshort = NULL;
+static uint8_t *title = NULL;
+static uint8_t *titleshort = NULL;
 
 void restore256_palette (void);
 void set16color_palette (void);
--- a/Game/src/actors.c
+++ b/Game/src/actors.c
@@ -774,7 +774,7 @@
     int32_t gutz,floorz;
     short i,a,j;
     char sx,sy;
-    signed char pal;
+    int8_t pal;
 
     if(badguy(s) && s->xrepeat < 16)
         sx = sy = 8;
--- a/Game/src/animlib.c
+++ b/Game/src/animlib.c
@@ -120,7 +120,7 @@
 
 void CPlayRunSkipDump (byte *srcP, byte *dstP)
    {
-   signed char cnt;
+   int8_t cnt;
    uint16 wordCnt;
    byte pixel;
 
--- a/Game/src/duke3d.h
+++ b/Game/src/duke3d.h
@@ -339,7 +339,7 @@
 
 typedef struct
 {
-    signed char avel, horz;
+    int8_t avel, horz;
     short fvel, svel;
     uint32_t bits;
 } input;
@@ -663,7 +663,7 @@
 
 extern char pus,pub,camerashitable,freezerhurtowner,lasermode;
 extern char syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
-extern signed char multiwho, multipos, multiwhat, multiflag;
+extern int8_t multiwho, multipos, multiwhat, multiflag;
 extern int32_t syncvalhead[MAXPLAYERS], syncvaltail, syncvaltottail;
 extern int32_t numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
 // CTW - MODIFICATION
--- a/Game/src/funct.h
+++ b/Game/src/funct.h
@@ -234,9 +234,9 @@
 //#line "menues.c" 67
 extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
 //#line "menues.c" 105
-extern int loadplayer(signed char spot);
+extern int loadplayer(int8_t spot);
 //#line "menues.c" 276
-extern int saveplayer(signed char spot);
+extern int saveplayer(int8_t spot);
 //#line "menues.c" 421
 extern void sendgameinfo(void );
 //#line "menues.c" 434
@@ -304,7 +304,7 @@
 //#line "gamedef.c" 2699
 extern void execute(short i,short p,int32_t x);
 //#line "game.c" 63
-extern void overwritesprite(int32_t thex,int32_t they,short tilenum,signed char shade,char stat,char dapalnum);
+extern void overwritesprite(int32_t thex,int32_t they,short tilenum,int8_t shade,char stat,char dapalnum);
 //#line "game.c" 70
 extern void timerhandler(void);
 //#line "game.c" 75
@@ -338,9 +338,9 @@
 //#line "game.c" 924
 extern short badguypic(short pn);
 //#line "game.c" 963
-extern void myos(int32_t x,int32_t y,short tilenum,signed char shade,char orientation);
+extern void myos(int32_t x,int32_t y,short tilenum,int8_t shade,char orientation);
 //#line "game.c" 976
-extern void myospal(int32_t x,int32_t y,short tilenum,signed char shade,char orientation,char p);
+extern void myospal(int32_t x,int32_t y,short tilenum,int8_t shade,char orientation,char p);
 //#line "game.c" 991
 extern void invennum(int32_t x,int32_t y,char num1,char ha,char sbits);
 //#line "game.c" 1021
@@ -391,7 +391,7 @@
 //#line "game.c" 2445
 extern short LocateTheLocator(short n,short sn);
 //#line "game.c" 2459
-extern short EGS(short whatsect,int32_t s_x,int32_t s_y,int32_t s_z,short s_pn,signed char s_s,signed char s_xr,signed char s_yr,short s_a,short s_ve,int32_t s_zv,short s_ow,signed char s_ss);
+extern short EGS(short whatsect,int32_t s_x,int32_t s_y,int32_t s_z,short s_pn,int8_t s_s,int8_t s_xr,int8_t s_yr,short s_a,short s_ve,int32_t s_zv,short s_ow,int8_t s_ss);
 //#line "game.c" 2537
 extern char wallswitchcheck(short i);
 //#line "game.c" 2588
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -1391,7 +1391,7 @@
 
 
 
-void myos(int32_t x, int32_t y, short tilenum, signed char shade, char orientation)
+void myos(int32_t x, int32_t y, short tilenum, int8_t shade, char orientation)
 {
     char p;
     short a;
@@ -1404,7 +1404,7 @@
     rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
 }
 
-void myospal(int32_t x, int32_t y, short tilenum, signed char shade, char orientation, char p)
+void myospal(int32_t x, int32_t y, short tilenum, int8_t shade, char orientation, char p)
 {
     char fp;
     short a;
@@ -3441,7 +3441,7 @@
     return -1;
 }
 
-short EGS(short whatsect,int32_t s_x,int32_t s_y,int32_t s_z,short s_pn,signed char s_s,signed char s_xr,signed char s_yr,short s_a,short s_ve,int32_t s_zv,short s_ow,signed char s_ss)
+short EGS(short whatsect,int32_t s_x,int32_t s_y,int32_t s_z,short s_pn,int8_t s_s,int8_t s_xr,int8_t s_yr,short s_a,short s_ve,int32_t s_zv,short s_ow,int8_t s_ss)
 {
     short i;
     spritetype *s;
--- a/Game/src/global.c
+++ b/Game/src/global.c
@@ -193,7 +193,7 @@
 short myang, omyang, mycursectnum, myjumpingcounter,frags[MAXPLAYERS][MAXPLAYERS];
 
 char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
-signed char multiwho, multipos, multiwhat, multiflag;
+int8_t multiwho, multipos, multiwhat, multiflag;
 
 int32_t fakemovefifoplc,movefifoplc;
 int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
--- a/Game/src/menues.c
+++ b/Game/src/menues.c
@@ -213,7 +213,7 @@
 }
 
 
-int loadplayer(signed char spot)
+int loadplayer(int8_t spot)
 {
      short k,music_changed;
      char fn[] = "game0.sav";
@@ -539,7 +539,7 @@
      return(0);
 }
 
-int saveplayer(signed char spot)
+int saveplayer(int8_t spot)
 {
      int32_t i, j;
          char fn[] = "game0.sav";
--- a/Game/src/midi/databuf.h
+++ b/Game/src/midi/databuf.h
@@ -31,7 +31,7 @@
 typedef unsigned short uint16;
 typedef uint32_t uint32;
 
-typedef signed char sint8;
+typedef int8_t sint8;
 typedef signed short sint16;
 typedef int32_t sint32;
 
--- a/Game/src/player.c
+++ b/Game/src/player.c
@@ -1298,7 +1298,7 @@
     int32_t gun_pos, looking_arc, cw;
     int32_t weapon_xoffset, i, j;
     char o,pal;
-    signed char gs;
+    int8_t gs;
     struct player_struct *p;
     short *kb;
 
@@ -1644,7 +1644,7 @@
 
 				case HANDREMOTE_WEAPON:
 				{
-						signed char remote_frames[] = {0,1,1,2,1,1,0,0,0,0,0};
+						int8_t remote_frames[] = {0,1,1,2,1,1,0,0,0,0,0};
 						if(sprite[p->i].pal == 1)
 							pal = 1;
 						else
--- a/Game/src/premap.c
+++ b/Game/src/premap.c
@@ -1281,7 +1281,7 @@
 void genspriteremaps(void)
 {
     int32_t j,fp;
-    signed char look_pos;
+    int8_t look_pos;
     char *lookfn = "lookup.dat";
     char numl;
 
@@ -1293,7 +1293,7 @@
 
     for(j=0;j < numl;j++)
     {
-        kread(fp,(signed char *)&look_pos,1);
+        kread(fp,(int8_t *)&look_pos,1);
         kread(fp,tempbuf,256);
         makepalookup((long)look_pos,tempbuf,0,0,0,1);
     }
--- a/Game/src/types.h
+++ b/Game/src/types.h
@@ -42,7 +42,7 @@
 
 typedef uint8_t            uint8;
 typedef uint8                   byte;
-typedef signed char             int8;
+typedef int8_t             int8;
 
 typedef unsigned short int      uint16;
 typedef uint16                  word;