From ec15323a44b0526862320693abd66fb5b717c435 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 6 Feb 2024 14:00:19 +0100 Subject: [PATCH] establish an `int` type variable naming scheme (#50) * short int -> short, long int -> long * unsigned -> unsigned int * longword -> unsigned int * word -> unsigned short --- rott/_rt_acto.h | 2 +- rott/_rt_stat.h | 6 +-- rott/_rt_ted.h | 4 +- rott/fx_man.h | 2 +- rott/fx_mixer.c | 2 +- rott/rt_actor.c | 18 +++---- rott/rt_actor.h | 12 ++--- rott/rt_battl.h | 30 +++++------ rott/rt_cfg.c | 2 +- rott/rt_com.c | 20 ++++---- rott/rt_crc.c | 8 +-- rott/rt_crc.h | 2 +- rott/rt_def.h | 2 - rott/rt_dmand.c | 4 +- rott/rt_dmand.h | 4 +- rott/rt_door.c | 26 +++++----- rott/rt_door.h | 18 +++---- rott/rt_draw.c | 18 +++---- rott/rt_draw.h | 2 +- rott/rt_floor.c | 8 +-- rott/rt_game.c | 20 ++++---- rott/rt_game.h | 8 +-- rott/rt_in.c | 50 +++++++++---------- rott/rt_in.h | 22 ++++---- rott/rt_main.c | 6 +-- rott/rt_main.h | 2 +- rott/rt_menu.c | 4 +- rott/rt_net.c | 10 ++-- rott/rt_net.h | 18 +++---- rott/rt_playr.h | 2 +- rott/rt_scale.c | 16 +++--- rott/rt_stat.h | 10 ++-- rott/rt_str.c | 16 +++--- rott/rt_str.h | 8 +-- rott/rt_ted.c | 130 ++++++++++++++++++++++++------------------------ rott/rt_ted.h | 20 ++++---- rott/rt_util.c | 16 +++--- rott/rt_vid.c | 12 ++--- rott/rt_vid.h | 6 +-- rott/rt_view.c | 50 +++++++++---------- rott/rt_view.h | 2 +- rott/w_wad.c | 4 +- rott/z_zone.c | 2 +- 43 files changed, 311 insertions(+), 313 deletions(-) diff --git a/rott/_rt_acto.h b/rott/_rt_acto.h index f39eaa5..48152ff 100644 --- a/rott/_rt_acto.h +++ b/rott/_rt_acto.h @@ -240,7 +240,7 @@ enum { typedef struct sat { int x,y,z; - unsigned flags; + unsigned int flags; int hitpoints; int targetx,targety; int angle; diff --git a/rott/_rt_stat.h b/rott/_rt_stat.h index 4ffcfd6..743572f 100644 --- a/rott/_rt_stat.h +++ b/rott/_rt_stat.h @@ -45,12 +45,12 @@ typedef struct sas int flags; signed char ticcount; int hitpoints; - short int shapenum; + short shapenum; signed char ammo; signed char count; signed char itemnumber; - short int areanumber; - short int whichstat; + short areanumber; + short whichstat; byte numanims; int linked_to; }saved_stat_type; diff --git a/rott/_rt_ted.h b/rott/_rt_ted.h index 9789b51..62fbe1f 100644 --- a/rott/_rt_ted.h +++ b/rott/_rt_ted.h @@ -55,8 +55,8 @@ typedef struct typedef struct { int planestart[3]; - word planelength[3]; - word width,height; + unsigned short planelength[3]; + unsigned short width,height; char name[16]; } maptype; diff --git a/rott/fx_man.h b/rott/fx_man.h index 70e7751..8b2a6ed 100644 --- a/rott/fx_man.h +++ b/rott/fx_man.h @@ -60,7 +60,7 @@ enum FX_ERRORS char *FX_ErrorString( int ErrorNumber ); int FX_SetupCard( int SoundCard, fx_device *device ); -int FX_Init( int SoundCard, int numvoices, int numchannels, int samplebits, unsigned mixrate ); +int FX_Init( int SoundCard, int numvoices, int numchannels, int samplebits, unsigned int mixrate ); int FX_Shutdown( void ); int FX_SetCallBack( void ( *function )( unsigned long ) ); void FX_SetVolume( int volume ); diff --git a/rott/fx_mixer.c b/rott/fx_mixer.c index 4d3e1ea..a7a2dc8 100644 --- a/rott/fx_mixer.c +++ b/rott/fx_mixer.c @@ -287,7 +287,7 @@ int FX_Shutdown(void) extern int SoundNumber(int x); int FX_Init(int SoundCard, int numvoices, int numchannels, int samplebits, - unsigned mixrate) + unsigned int mixrate) { int i; diff --git a/rott/rt_actor.c b/rott/rt_actor.c index 85c6d87..02b7fef 100644 --- a/rott/rt_actor.c +++ b/rott/rt_actor.c @@ -1400,7 +1400,7 @@ void GetMomenta(objtype *target, objtype *source, int *newmomx, -void SpawnNewObj (unsigned tilex, unsigned tiley, statetype *state, classtype which) +void SpawnNewObj (unsigned int tilex, unsigned int tiley, statetype *state, classtype which) { int newarea; @@ -4476,7 +4476,7 @@ void T_PlayDead(objtype *ob) } -void AdjustAngle(int maxadjust, short int *currangle,int targetangle) +void AdjustAngle(int maxadjust, short *currangle,int targetangle) { int dangle,i,magangle; @@ -8478,7 +8478,7 @@ void T_Heinrich_Out_of_Control(objtype*ob) { ob->dir = dirorder[ob->dir][PREV]; ob->angle = dirangle8[ob->dir]; - if (ob->dir == (unsigned)ob->temp2) + if (ob->dir == (unsigned int)ob->temp2) { if (ob->temp1 > 1) ob->temp1--; @@ -8648,7 +8648,7 @@ void T_KristLeft(objtype*ob) ActorMovement(ob); if (!ob->ticcount) {SD_PlaySoundRTP(SD_KRISTTURNSND,ob->x,ob->y); - if (ob->dir != (unsigned)ob->temp1) + if (ob->dir != (unsigned int)ob->temp1) ob->dir = dirorder[ob->dir][NEXT]; else {ob->temp1 = 0; @@ -8663,7 +8663,7 @@ void T_KristRight(objtype*ob) ActorMovement(ob); if (!ob->ticcount) {SD_PlaySoundRTP(SD_KRISTTURNSND,ob->x,ob->y); - if (ob->dir != (unsigned)ob->temp1) + if (ob->dir != (unsigned int)ob->temp1) ob->dir = dirorder[ob->dir][PREV]; else {ob->temp1 = 0; @@ -9035,7 +9035,7 @@ void SelectOrobotChaseDir(objtype*ob) // this code is for head { tdir = (ob->temp1 & 0xf); - if ((head->dir == (unsigned)tdir) && (ob->dir == (unsigned)tdir)) // increment + if ((head->dir == (unsigned int)tdir) && (ob->dir == (unsigned int)tdir)) // increment // tried dir if robot will attempt to move at tdir => // head and body are at move try dir {//Debug("\ntrying next queue dir %d",tdir); @@ -9254,7 +9254,7 @@ void T_NME_SpinFire(objtype*ob) head = (objtype*)(ob->whatever); wheels = (objtype*)(ob->target); - if (ob->dir != (unsigned)ob->targettilex) + if (ob->dir != (unsigned int)ob->targettilex) {ob->dir = head->dir = wheels->dir = dirorder16[ob->dir][ob->temp3]; return; } @@ -9568,7 +9568,7 @@ void SelectSnakeDir (objtype *ob) spot = MAPSPOT(ob->tilex,ob->tiley,1)-ICONARROWS; - if ((spot >= 0) && (spot<= 7) && ((ob->dir!=(unsigned)spot)||(!(ob->flags & FL_DONE)))) + if ((spot >= 0) && (spot<= 7) && ((ob->dir!=(unsigned int)spot)||(!(ob->flags & FL_DONE)))) { centerx= (ob->tilex << 16) + HALFGLOBAL1; centery= (ob->tiley << 16) + HALFGLOBAL1; dx = abs(centerx - ob->x); @@ -9792,7 +9792,7 @@ void T_DarkSnakeChase(objtype*ob) angle = AngleBetween(ob,PLAYER[0]); tdir = angletodir[angle]; - if (Near(ob,PLAYER[0],6) && (ob->dir == (unsigned)tdir) && (!(ob->state->condition & SF_DOWN))) + if (Near(ob,PLAYER[0],6) && (ob->dir == (unsigned int)tdir) && (!(ob->state->condition & SF_DOWN))) { NewState(ob,&s_snakefire1); SD_PlaySoundRTP(SD_SNAKEREADYSND,ob->x,ob->y); diff --git a/rott/rt_actor.h b/rott/rt_actor.h index fc3358e..31a62a8 100644 --- a/rott/rt_actor.h +++ b/rott/rt_actor.h @@ -217,10 +217,10 @@ typedef struct objstruct byte tilex,tiley; fixed x,y,z; int shapenum; - unsigned flags; + unsigned int flags; short ticcount; signed short hitpoints; - word whichactor; + unsigned short whichactor; signed short dirchoosetime; fixed drawx,drawy; @@ -233,8 +233,8 @@ typedef struct objstruct dirtype dir; - short int angle; - short int yzangle; + short angle; + short yzangle; int soundhandle; int speed; @@ -366,7 +366,7 @@ void SpawnDeadGuard (int tilex, int tiley); void SpawnWallfire(int tilex, int tiley, int dir); void SpawnMissile(objtype*,classtype,int,int,statetype*,int); -void InitHitRect (objtype *ob, unsigned radius); +void InitHitRect (objtype *ob, unsigned int radius); void NewState (objtype *ob, statetype *state); void SelectPathDir(objtype*); void SelectChaseDir (objtype *ob); @@ -399,7 +399,7 @@ void T_Roll(objtype*); void T_BossDied (objtype *ob); boolean QuickSpaceCheck(objtype*,int,int); void PushWallMove(int num); -void SpawnNewObj(unsigned,unsigned,statetype*,classtype); +void SpawnNewObj(unsigned int,unsigned int,statetype*,classtype); void SpawnSpring(int,int); void SpawnFourWayGun(int,int); void SpawnSnake(int tilex,int tiley); diff --git a/rott/rt_battl.h b/rott/rt_battl.h index afff448..7bcf597 100644 --- a/rott/rt_battl.h +++ b/rott/rt_battl.h @@ -174,23 +174,23 @@ enum // typedef struct { - unsigned Gravity; - unsigned Speed; - unsigned Ammo; - unsigned HitPoints; - unsigned SpawnDangers; - unsigned SpawnHealth; - unsigned SpawnWeapons; - unsigned SpawnMines; - unsigned RespawnItems; - unsigned WeaponPersistence; - unsigned RandomWeapons; - unsigned FriendlyFire; - unsigned LightLevel; + unsigned int Gravity; + unsigned int Speed; + unsigned int Ammo; + unsigned int HitPoints; + unsigned int SpawnDangers; + unsigned int SpawnHealth; + unsigned int SpawnWeapons; + unsigned int SpawnMines; + unsigned int RespawnItems; + unsigned int WeaponPersistence; + unsigned int RandomWeapons; + unsigned int FriendlyFire; + unsigned int LightLevel; int Kills; int DangerDamage; - unsigned TimeLimit; - unsigned RespawnTime; + unsigned int TimeLimit; + unsigned int RespawnTime; } battle_type; #define bo_normal_respawn_time 30 diff --git a/rott/rt_cfg.c b/rott/rt_cfg.c index b472fed..571d00d 100644 --- a/rott/rt_cfg.c +++ b/rott/rt_cfg.c @@ -196,7 +196,7 @@ void ReadUnsigned (const char * s1, unsigned long * val) temp = (int)(*val); ReadInt (s1,&temp); - *val = (unsigned) temp; + *val = (unsigned int) temp; } //****************************************************************************** diff --git a/rott/rt_com.c b/rott/rt_com.c index d5006cd..d141a2a 100644 --- a/rott/rt_com.c +++ b/rott/rt_com.c @@ -181,7 +181,7 @@ void InitROTTNET (void) if (!quiet) { - printf("ROTTNET: consoleplayer=%ld\n",(long int)rottcom->consoleplayer); + printf("ROTTNET: consoleplayer=%ld\n",(long)rottcom->consoleplayer); } } @@ -195,8 +195,8 @@ void InitROTTNET (void) boolean ReadPacket (void) { - word crc; - word sentcrc; + unsigned short crc; + unsigned short sentcrc; // Set command (Get Packet) rottcom->command=CMD_GET; @@ -214,10 +214,10 @@ boolean ReadPacket (void) if (rottcom->remotenode!=-1) { // calculate crc on packet - crc=CalculateCRC ((byte *)&rottcom->data[0], rottcom->datalength-sizeof(word)); + crc=CalculateCRC ((byte *)&rottcom->data[0], rottcom->datalength-sizeof(unsigned short)); // get crc inside packet - sentcrc=*((word *)(&rottcom->data[rottcom->datalength-sizeof(word)])); + sentcrc=*((unsigned short *)(&rottcom->data[rottcom->datalength-sizeof(unsigned short)])); // are the crcs the same? if (crc!=sentcrc) @@ -255,7 +255,7 @@ boolean ReadPacket (void) void WritePacket (void * buffer, int len, int destination) { - word crc; + unsigned short crc; if (!rottcom) return; @@ -266,7 +266,7 @@ void WritePacket (void * buffer, int len, int destination) // set destination rottcom->remotenode=destination; - if (len>(int)(MAXCOMBUFFERSIZE-sizeof(word))) + if (len>(int)(MAXCOMBUFFERSIZE-sizeof(unsigned short))) { Error("WritePacket: Overflowed buffer\n"); } @@ -278,10 +278,10 @@ void WritePacket (void * buffer, int len, int destination) crc=CalculateCRC (buffer, len); // put CRC into realmode buffer packet - *((word *)&rottcom->data[len])=crc; + *((unsigned short *)&rottcom->data[len])=crc; // set size of realmode packet including crc - rottcom->datalength=len+sizeof(word); + rottcom->datalength=len+sizeof(unsigned short); if (*((byte *)buffer)==0) Error("Packet type = 0\n"); @@ -447,7 +447,7 @@ void ComSetTime ( void ) else if (i!=consoleplayer) SyncTime(i); if (standalone==true) - printf("ComSetTime: player#%ld\n",(long int)i); + printf("ComSetTime: player#%ld\n",(long)i); } } else diff --git a/rott/rt_crc.c b/rott/rt_crc.c index 38a4e26..b042097 100644 --- a/rott/rt_crc.c +++ b/rott/rt_crc.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "rt_crc.h" /* variables */ -static const unsigned short int crc16tab[256] = +static const unsigned short crc16tab[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, @@ -76,9 +76,9 @@ int updatecrc(int crc, int c) // //****************************************************************************** -word CalculateCRC (byte *source, unsigned size) +unsigned short CalculateCRC (byte *source, unsigned int size) { - unsigned i; + unsigned int i; int checksum; int tmp; @@ -90,7 +90,7 @@ word CalculateCRC (byte *source, unsigned size) checksum=(checksum>>8)^crc16tab[tmp & 0xff]; } - return ((word)checksum); + return ((unsigned short)checksum); } diff --git a/rott/rt_crc.h b/rott/rt_crc.h index 589d4a3..f4784ab 100644 --- a/rott/rt_crc.h +++ b/rott/rt_crc.h @@ -20,5 +20,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "rt_def.h" int updatecrc(int,int); -word CalculateCRC (byte *source, unsigned size); +unsigned short CalculateCRC (byte *source, unsigned int size); diff --git a/rott/rt_def.h b/rott/rt_def.h index 695c31b..72d431d 100644 --- a/rott/rt_def.h +++ b/rott/rt_def.h @@ -262,8 +262,6 @@ long filelength(int handle); typedef unsigned char byte; -typedef unsigned short int word; -typedef unsigned int longword; typedef int fixed; diff --git a/rott/rt_dmand.c b/rott/rt_dmand.c index 064588d..be93d3d 100644 --- a/rott/rt_dmand.c +++ b/rott/rt_dmand.c @@ -139,7 +139,7 @@ void SD_StopIncomingSound ( void ) // //*************************************************************************** -void SD_UpdateIncomingSound ( byte * ptr, word length ) +void SD_UpdateIncomingSound ( byte * ptr, unsigned short length ) { int amount; @@ -330,7 +330,7 @@ boolean SD_RecordingActive ( void ) // //*************************************************************************** -recordstate SD_GetSoundData ( byte * data, word length ) +recordstate SD_GetSoundData ( byte * data, unsigned short length ) { recordstate status=rs_data; int amount; diff --git a/rott/rt_dmand.h b/rott/rt_dmand.h index 465c2b0..e6d1ee9 100644 --- a/rott/rt_dmand.h +++ b/rott/rt_dmand.h @@ -49,7 +49,7 @@ void SD_StopIncomingSound ( void ); // //*************************************************************************** -void SD_UpdateIncomingSound ( byte * data, word length ); +void SD_UpdateIncomingSound ( byte * data, unsigned short length ); //*************************************************************************** // @@ -62,7 +62,7 @@ void SD_UpdateIncomingSound ( byte * data, word length ); // //*************************************************************************** -recordstate SD_GetSoundData ( byte * data, word length ); +recordstate SD_GetSoundData ( byte * data, unsigned short length ); //*************************************************************************** // diff --git a/rott/rt_door.c b/rott/rt_door.c index 2b01a20..3719e9d 100644 --- a/rott/rt_door.c +++ b/rott/rt_door.c @@ -485,7 +485,7 @@ void RemoveTouchplateAction(touchplatetype *tplate,int index) -void Link_To_Touchplate(word touchlocx, word touchlocy, void (*maction)(intptr_t), void (*swapaction)(intptr_t), intptr_t wobj, int delaytime) +void Link_To_Touchplate(unsigned short touchlocx, unsigned short touchlocy, void (*maction)(intptr_t), void (*swapaction)(intptr_t), intptr_t wobj, int delaytime) {touchplatetype *temp; int index; @@ -1801,7 +1801,7 @@ void DoorOpen (int door) void DoorOpening (int door) { int area1,area2; - word *map; + unsigned short *map; long position; int tilex,tiley; @@ -1869,7 +1869,7 @@ void DoorOpening (int door) void DoorClosing (int door) { int area1,area2; - word *map; + unsigned short *map; long position; int tilex,tiley; doorobj_t *dptr; @@ -1968,7 +1968,7 @@ int IsMaskedWall (int tilex, int tiley) void SpawnMaskedWall (int tilex, int tiley, int which, int flags) -{word *map; +{unsigned short *map; int area1, area2; int up,dn,lt,rt; int himask; @@ -3164,7 +3164,7 @@ void SpawnPushWall (int tilex, int tiley, int lock, int texture, int dir, int ty PreCacheLump(texture,PU_CACHEWALLS,cache_pic_t); lastpwallobj->areanumber = GetAreaNumber(tilex,tiley,lastpwallobj->dir); - MAPSPOT (tilex, tiley, 0)=(word)(lastpwallobj->areanumber+AREATILE); + MAPSPOT (tilex, tiley, 0)=(unsigned short)(lastpwallobj->areanumber+AREATILE); switch(type) { @@ -3356,7 +3356,7 @@ void ConnectPushWall (int pwall) int checky; int area1,area2; int area3,area4; - word *map; + unsigned short *map; pwallobj_t * pw; pw=pwallobjlist[pwall]; @@ -3593,7 +3593,7 @@ void WallPushing (int pwall) if ((area<=0) || (area>NUMAREAS)) { area=pw->areanumber; - MAPSPOT (pw->tilex, pw->tiley, 0)=(word)(pw->areanumber+AREATILE); + MAPSPOT (pw->tilex, pw->tiley, 0)=(unsigned short)(pw->areanumber+AREATILE); } // block crossed into a new block // @@ -3689,7 +3689,7 @@ void WallMoving (int pwall) if ((area<=0) || (area>NUMAREAS)) { area=pw->areanumber; - MAPSPOT (pw->tilex, pw->tiley, 0)=(word)(pw->areanumber+AREATILE); + MAPSPOT (pw->tilex, pw->tiley, 0)=(unsigned short)(pw->areanumber+AREATILE); } // block crossed into a new block // @@ -3736,7 +3736,7 @@ void WallMoving (int pwall) if ((area<=0) || (area>NUMAREAS)) { area=pw->areanumber; - MAPSPOT (pw->tilex, pw->tiley, 0)=(word)(pw->areanumber+AREATILE); + MAPSPOT (pw->tilex, pw->tiley, 0)=(unsigned short)(pw->areanumber+AREATILE); } if (areabyplayer[area] && (abs(spot-pw->dir)==4)) @@ -3897,7 +3897,7 @@ void LoadPushWalls(byte * bufptr, int sz) area = MAPSPOT(new.tilex,new.tiley,0)-AREATILE; if ((area<=0) || (area>NUMAREAS)) { - MAPSPOT (new.tilex, new.tiley, 0)=(word)(pw->areanumber+AREATILE); + MAPSPOT (new.tilex, new.tiley, 0)=(unsigned short)(pw->areanumber+AREATILE); } pw->tilex=new.tilex; @@ -4001,7 +4001,7 @@ void LoadMaskedWalls(byte * bufptr, int sz) for (i=0;iflags); @@ -4030,7 +4030,7 @@ void SaveDoors (byte ** buf, int * size) byte doorflag; byte doorlocked; signed char dooreindex; - short int doortime; + short doortime; int unitsize; byte *ptr; @@ -4095,7 +4095,7 @@ void LoadDoors (byte * buf, int size) byte doorflag; byte doorlocked; signed char dooreindex; - short int doortime; + short doortime; byte *ptr; int unitsize; int num; diff --git a/rott/rt_door.h b/rott/rt_door.h index 405190b..aa4f2aa 100644 --- a/rott/rt_door.h +++ b/rott/rt_door.h @@ -91,13 +91,13 @@ typedef struct doorstruct { thingtype which; byte tilex,tiley; - word texture; - word alttexture; - word sidepic; - word basetexture; + unsigned short texture; + unsigned short alttexture; + unsigned short sidepic; + unsigned short basetexture; byte lock; byte flags; - short int ticcount; + short ticcount; signed char eindex; boolean vertical; int soundhandle; @@ -116,7 +116,7 @@ typedef struct pwallstruct byte tilex,tiley; byte num; byte speed; - word texture; + unsigned short texture; int soundhandle; enum {pw_npushed,pw_pushing,pw_pushed,pw_moving} action; int state; @@ -162,7 +162,7 @@ typedef struct mwall signed short toptexture; signed short midtexture; signed short bottomtexture; - word flags; + unsigned short flags; boolean vertical; int sidepic; @@ -173,7 +173,7 @@ typedef struct mwall typedef struct animmwall { - word num; + unsigned short num; byte count; signed char ticcount; struct animmwall *next; @@ -213,7 +213,7 @@ void OperateElevatorDoor(int); int PlatformHeight(int,int); -void Link_To_Touchplate(word, word, void (*)(intptr_t), void (*)(intptr_t), intptr_t, int); +void Link_To_Touchplate(unsigned short, unsigned short, void (*)(intptr_t), void (*)(intptr_t), intptr_t, int); void TriggerStuff(void); void ClockLink(void (*)(intptr_t),void(*)(intptr_t),intptr_t,int); void RecursiveConnect(int); diff --git a/rott/rt_draw.c b/rott/rt_draw.c index ca81c8a..fd32286 100644 --- a/rott/rt_draw.c +++ b/rott/rt_draw.c @@ -79,7 +79,7 @@ int whereami=-1; byte * shadingtable; -word tilemap[MAPSIZE][MAPSIZE]; // wall values only +unsigned short tilemap[MAPSIZE][MAPSIZE]; // wall values only byte spotvis[MAPSIZE][MAPSIZE]; byte mapseen[MAPSIZE][MAPSIZE]; unsigned long * lights; @@ -2271,7 +2271,7 @@ void InterpolateDoor (visobj_t * plane) if ((i>=0 && i>DHEIGHTFRACTION)) ) { dc_invscale=height>>(HEIGHTFRACTION+DHEIGHTFRACTION-10); - dc_iscale = 0xffffffffu/(unsigned)dc_invscale; + dc_iscale = 0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=((pheight-nominalheight+p->topoffset)<>1); sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale); @@ -2392,7 +2392,7 @@ void InterpolateMaskedWall (visobj_t * plane) if ((i>=0 && i>DHEIGHTFRACTION)) ) { dc_invscale=height>>(HEIGHTFRACTION+DHEIGHTFRACTION-10); - dc_iscale = 0xffffffffu/(unsigned)dc_invscale; + dc_iscale = 0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=((pheight-nominalheight+topoffset)<>1); sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale); @@ -3026,7 +3026,7 @@ void ApogeeTitle (void) #define APOGEESTARTY 0 #define APOGEEENDY 100 -#define APOGEESCALESTART ((unsigned)FINEANGLES<<4) +#define APOGEESCALESTART ((unsigned int)FINEANGLES<<4) #define APOGEESCALEEND (FINEANGLES) #define APOGEESONGTIME (124-1) @@ -3142,7 +3142,7 @@ void RotationFun ( void ) int angle; int scale; int x,y; - word buttons; + unsigned short buttons; //save off fastcounter @@ -5100,8 +5100,8 @@ void DrawMapPost (int height, byte * src, byte * buf) void DrawRotRow(int count, byte * dest, byte * src) { - unsigned eax, ecx, edx; -// unsigned a, b, c,d; + unsigned int eax, ecx, edx; +// unsigned int a, b, c,d; ecx = mr_yfrac; edx = mr_xfrac; @@ -5140,8 +5140,8 @@ void DrawRotRow(int count, byte * dest, byte * src) void DrawMaskedRotRow(int count, byte * dest, byte * src) { - unsigned eax; - unsigned xfrac, yfrac; + unsigned int eax; + unsigned int xfrac, yfrac; xfrac = mr_xfrac; yfrac = mr_yfrac; diff --git a/rott/rt_draw.h b/rott/rt_draw.h index f54105c..4242e2b 100644 --- a/rott/rt_draw.h +++ b/rott/rt_draw.h @@ -48,7 +48,7 @@ byte * colormap; } visobj_t; -extern word tilemap[MAPSIZE][MAPSIZE]; // wall values only +extern unsigned short tilemap[MAPSIZE][MAPSIZE]; // wall values only extern byte spotvis[MAPSIZE][MAPSIZE]; extern int tics; diff --git a/rott/rt_floor.c b/rott/rt_floor.c index ace15c8..b41b178 100644 --- a/rott/rt_floor.c +++ b/rott/rt_floor.c @@ -347,12 +347,12 @@ void SetPlaneViewSize (void) if (MAPSPOT(1,0,0) >= 234) { - word crud; + unsigned short crud; sky = (MAPSPOT(1,0,0) - 233); if ((sky<1) || (sky>6)) Error("Illegal Sky Tile = %d\n",sky); ceilingnum=1; - crud=(word)MAPSPOT(1,0,1); + crud=(unsigned short)MAPSPOT(1,0,1); if ((crud>=90) && (crud<=97)) horizonheight=crud-89; else if ((crud>=450) && (crud<=457)) @@ -362,7 +362,7 @@ void SetPlaneViewSize (void) // Check for lightnign icon - crud=(word)MAPSPOT(4,0,1); + crud=(unsigned short)MAPSPOT(4,0,1); if (crud==377) lightning=true; } @@ -592,7 +592,7 @@ void DrawPlanes( void ) void DrawRow(int count, byte * dest, byte * src) { - unsigned xfrac, yfrac; + unsigned int xfrac, yfrac; int coord; xfrac = mr_xfrac; diff --git a/rott/rt_game.c b/rott/rt_game.c index bd43aba..c76ee75 100644 --- a/rott/rt_game.c +++ b/rott/rt_game.c @@ -1009,7 +1009,7 @@ void DrawPlayers // //****************************************************************************** -void StatusDrawPic (unsigned x, unsigned y, pic_t *nums, boolean bufferofsonly) +void StatusDrawPic (unsigned int x, unsigned int y, pic_t *nums, boolean bufferofsonly) { DrawMPPic (x, y, nums->width, nums->height, 0, (byte *)&nums->data, bufferofsonly); @@ -1021,7 +1021,7 @@ void StatusDrawPic (unsigned x, unsigned y, pic_t *nums, boolean bufferofsonly) // //****************************************************************************** -void StatusDrawColoredPic (unsigned x, unsigned y, pic_t *nums, boolean bufferofsonly, int color) +void StatusDrawColoredPic (unsigned int x, unsigned int y, pic_t *nums, boolean bufferofsonly, int color) { DrawColoredMPPic (x, y, nums->width, nums->height, 0, (byte *)&nums->data, bufferofsonly, color); @@ -1064,7 +1064,7 @@ void DrawGameString (int x, int y, const char * str, boolean bufferofsonly) void DrawNumber (int x, int y, int width, int which, boolean bufferofsonly) { - unsigned length,c; + unsigned int length,c; char *str; byte z; @@ -1109,7 +1109,7 @@ void DrawNumber (int x, int y, int width, int which, boolean bufferofsonly) z--; } - c = length <= (unsigned)width ? 0 : length-width; + c = length <= (unsigned int)width ? 0 : length-width; while (c < length) { switch (which) @@ -1432,9 +1432,9 @@ void DrawKeys void StatusDrawTime ( - unsigned x, - unsigned y, - unsigned num, + unsigned int x, + unsigned int y, + unsigned int num, boolean bufferofsonly ) @@ -2780,9 +2780,9 @@ void DrawHighScores (void) // //****************************************************************************** -void CheckHighScore (long score, word other, boolean INMENU) +void CheckHighScore (long score, unsigned short other, boolean INMENU) { - word i,j; + unsigned short i,j; int n; HighScore myscore; int level; @@ -4886,7 +4886,7 @@ boolean LoadTheGame (int num, gamestorage_t * game) int checksum; int savedchecksum; int i; - word mapcrc; + unsigned short mapcrc; int myticcount; if (num>15 || num<0) diff --git a/rott/rt_game.h b/rott/rt_game.h index a64f698..1e0f886 100644 --- a/rott/rt_game.h +++ b/rott/rt_game.h @@ -54,7 +54,7 @@ typedef struct byte area; byte version; byte picture[16000]; - word mapcrc; + unsigned short mapcrc; AlternateInformation info; } gamestorage_t; @@ -62,7 +62,7 @@ typedef struct { char name[MaxHighName + 1]; long score; - word completed,episode; + unsigned short completed,episode; } HighScore; @@ -120,7 +120,7 @@ void GetSavedMessage (int num, char * message); void GetSavedHeader (int num, gamestorage_t * game); void DrawHighScores (void); -void CheckHighScore (long score, word other, boolean INMENU); +void CheckHighScore (long score, unsigned short other, boolean INMENU); void LevelCompleted ( exit_t playstate ); void BattleLevelCompleted ( int localplayer ); void Died (void); @@ -141,7 +141,7 @@ void DrawPause (void); void DrawPauseXY (int x, int y); void DrawColoredMPPic (int xpos, int ypos, int width, int height, int heightmod, byte *src, boolean bufferofsonly, int color); -void StatusDrawColoredPic (unsigned x, unsigned y, pic_t *nums, boolean bufferofsonly, int color); +void StatusDrawColoredPic (unsigned int x, unsigned int y, pic_t *nums, boolean bufferofsonly, int color); void ClearTriads (playertype * pstate); #endif diff --git a/rott/rt_in.c b/rott/rt_in.c index a6a29c1..1409efb 100644 --- a/rott/rt_in.c +++ b/rott/rt_in.c @@ -71,7 +71,7 @@ byte Joy_xb, Joy_yb, Joy_xs, Joy_ys; -word Joy_x, +unsigned short Joy_x, Joy_y; @@ -83,10 +83,10 @@ ModemMessage MSG; static SDL_Joystick* sdl_joysticks[MaxJoys]; static int sdl_mouse_delta_x = 0; static int sdl_mouse_delta_y = 0; -static word sdl_mouse_button_mask = 0; +static unsigned short sdl_mouse_button_mask = 0; static int sdl_total_sticks = 0; -static word *sdl_stick_button_state = NULL; -static word sdl_sticks_joybits = 0; +static unsigned short *sdl_stick_button_state = NULL; +static unsigned short sdl_sticks_joybits = 0; static int sdl_mouse_grabbed = 0; extern boolean sdl_fullscreen; @@ -453,13 +453,13 @@ void INL_GetMouseDelta(int *x,int *y) // //****************************************************************************** -word IN_GetMouseButtons +unsigned short IN_GetMouseButtons ( void ) { - word buttons = 0; + unsigned short buttons = 0; IN_PumpEvents(); @@ -500,7 +500,7 @@ void IN_IgnoreMouseButtons // //****************************************************************************** -void IN_GetJoyAbs (word joy, word *xp, word *yp) +void IN_GetJoyAbs (unsigned short joy, unsigned short *xp, unsigned short *yp) { Joy_x = Joy_y = 0; Joy_xs = joy? 2 : 0; // Find shift value for x axis @@ -534,9 +534,9 @@ void JoyStick_Vals (void) // //****************************************************************************** -void INL_GetJoyDelta (word joy, int *dx, int *dy) +void INL_GetJoyDelta (unsigned short joy, int *dx, int *dy) { - word x, y; + unsigned short x, y; JoystickDef *def; IN_GetJoyAbs (joy, &x, &y); @@ -598,9 +598,9 @@ void INL_GetJoyDelta (word joy, int *dx, int *dy) // //****************************************************************************** -word INL_GetJoyButtons (word joy) +unsigned short INL_GetJoyButtons (unsigned short joy) { - word result = 0; + unsigned short result = 0; if (joy < sdl_total_sticks) result = sdl_stick_button_state[joy]; @@ -633,7 +633,7 @@ boolean INL_StartMouse (void) // //****************************************************************************** -void INL_SetJoyScale (word joy) +void INL_SetJoyScale (unsigned short joy) { JoystickDef *def; @@ -653,9 +653,9 @@ void INL_SetJoyScale (word joy) // //****************************************************************************** -void IN_SetupJoy (word joy, word minx, word maxx, word miny, word maxy) +void IN_SetupJoy (unsigned short joy, unsigned short minx, unsigned short maxx, unsigned short miny, unsigned short maxy) { - word d,r; + unsigned short d,r; JoystickDef *def; def = &JoyDefs[joy]; @@ -686,9 +686,9 @@ void IN_SetupJoy (word joy, word minx, word maxx, word miny, word maxy) //****************************************************************************** -boolean INL_StartJoy (word joy) +boolean INL_StartJoy (unsigned short joy) { - word x,y; + unsigned short x,y; if (!SDL_WasInit(SDL_INIT_JOYSTICK)) { @@ -698,11 +698,11 @@ boolean INL_StartJoy (word joy) if ((sdl_stick_button_state == NULL) && (sdl_total_sticks > 0)) { - sdl_stick_button_state = (word *) malloc(sizeof (word) * sdl_total_sticks); + sdl_stick_button_state = (unsigned short *) malloc(sizeof (unsigned short) * sdl_total_sticks); if (sdl_stick_button_state == NULL) SDL_QuitSubSystem(SDL_INIT_JOYSTICK); else - memset(sdl_stick_button_state, '\0', sizeof (word) * sdl_total_sticks); + memset(sdl_stick_button_state, '\0', sizeof (unsigned short) * sdl_total_sticks); } SDL_JoystickEventState(SDL_ENABLE); } @@ -733,7 +733,7 @@ boolean INL_StartJoy (word joy) // //****************************************************************************** -void INL_ShutJoy (word joy) +void INL_ShutJoy (unsigned short joy) { JoysPresent[joy] = false; if (joy < sdl_total_sticks) SDL_JoystickClose (sdl_joysticks[joy]); @@ -753,7 +753,7 @@ void IN_Startup (void) boolean checkjoys, checkmouse; - word i; + unsigned short i; if (IN_Started==true) return; @@ -811,7 +811,7 @@ sdl_mouse_grabbed = 1; void IN_Shutdown (void) { - word i; + unsigned short i; if (IN_Started==false) return; @@ -848,7 +848,7 @@ void IN_ClearKeysDown (void) void IN_ReadControl (int player, ControlInfo *info) { boolean realdelta = false; - word buttons; + unsigned short buttons; int dx,dy; Motion mx,my; ControlType type; @@ -938,7 +938,7 @@ boolean btnstate[8]; void IN_StartAck (void) { - unsigned i, + unsigned int i, buttons = 0; // @@ -970,7 +970,7 @@ void IN_StartAck (void) boolean IN_CheckAck (void) { - unsigned i, + unsigned int i, buttons = 0; // @@ -1053,7 +1053,7 @@ boolean IN_UserInput (long delay) byte IN_JoyButtons (void) { - unsigned joybits = 0; + unsigned int joybits = 0; joybits = sdl_sticks_joybits; diff --git a/rott/rt_in.h b/rott/rt_in.h index 6e9b438..ca276c9 100644 --- a/rott/rt_in.h +++ b/rott/rt_in.h @@ -112,7 +112,7 @@ typedef struct typedef struct { - word joyMinX,joyMinY, + unsigned short joyMinX,joyMinY, threshMinX,threshMinY, threshMaxX,threshMaxY, joyMaxX,joyMaxY, @@ -158,7 +158,7 @@ extern byte Joy_xb, Joy_yb, Joy_xs, Joy_ys; -extern word Joy_x, +extern unsigned short Joy_x, Joy_y; extern int LastLetter; @@ -174,7 +174,7 @@ extern const char ScanChars[128]; //*************************************************************************** void INL_GetMouseDelta(int *x,int *y); -word IN_GetMouseButtons (void); +unsigned short IN_GetMouseButtons (void); void IN_IgnoreMouseButtons( void ); boolean INL_StartMouse (void); void INL_ShutMouse (void); @@ -191,14 +191,14 @@ void IN_StartAck (void); boolean IN_CheckAck (void); void IN_Ack (void); boolean IN_UserInput (long delay); -void IN_GetJoyAbs (word joy, word *xp, word *yp); -void INL_GetJoyDelta (word joy, int *dx, int *dy); -word INL_GetJoyButtons (word joy); -//word IN_GetJoyButtonsDB (word joy); -void INL_SetJoyScale (word joy); -void IN_SetupJoy (word joy, word minx, word maxx, word miny, word maxy); -boolean INL_StartJoy (word joy); -void INL_ShutJoy (word joy); +void IN_GetJoyAbs (unsigned short joy, unsigned short *xp, unsigned short *yp); +void INL_GetJoyDelta (unsigned short joy, int *dx, int *dy); +unsigned short INL_GetJoyButtons (unsigned short joy); +//unsigned short IN_GetJoyButtonsDB (unsigned short joy); +void INL_SetJoyScale (unsigned short joy); +void IN_SetupJoy (unsigned short joy, unsigned short minx, unsigned short maxx, unsigned short miny, unsigned short maxy); +boolean INL_StartJoy (unsigned short joy); +void INL_ShutJoy (unsigned short joy); byte IN_JoyButtons (void); void IN_UpdateKeyboard (void); void IN_ClearKeyboardQueue (void); diff --git a/rott/rt_main.c b/rott/rt_main.c index 0bc43cc..f2b66f9 100644 --- a/rott/rt_main.c +++ b/rott/rt_main.c @@ -646,7 +646,7 @@ void CheckCommandLineParameters( void ) if (numplayers>MAXPLAYERS) Error("Too many players.\n"); if (!quiet) - printf("Playing %ld player ROTT\n",(long int)numplayers); + printf("Playing %ld player ROTT\n",(long)numplayers); modemgame=true; if (rottcom->gametype==NETWORK_GAME) { @@ -680,7 +680,7 @@ void CheckCommandLineParameters( void ) timelimitenabled = true; timelimit = ParseNum(_argv[i + 1]); if (!quiet) - printf("Time Limit = %ld Seconds\n",(long int)timelimit); + printf("Time Limit = %ld Seconds\n",(long)timelimit); timelimit *= VBLCOUNTER; break; @@ -918,7 +918,7 @@ void Init_Tables (void) int i; int x, y; - unsigned *blockstart; + unsigned int *blockstart; byte * shape; memset (&CWD[0], 0, 40); diff --git a/rott/rt_main.h b/rott/rt_main.h index b5a0cf8..af514ed 100644 --- a/rott/rt_main.h +++ b/rott/rt_main.h @@ -82,7 +82,7 @@ typedef struct typedef struct { - unsigned Version; + unsigned int Version; // Variable for which version of the game can be played version_type Product; diff --git a/rott/rt_menu.c b/rott/rt_menu.c index 774179f..f4ed381 100644 --- a/rott/rt_menu.c +++ b/rott/rt_menu.c @@ -4333,7 +4333,7 @@ int CalibrateJoystick #define CALX 45 #define CALY 22 - word xmax, ymax, xmin, ymin, jb; + unsigned short xmax, ymax, xmin, ymin, jb; int checkbits; int status; boolean done; @@ -4674,7 +4674,7 @@ void WaitKeyUp (void) void ReadAnyControl (ControlInfo *ci) { int mouseactive = 0; - word buttons = 0; + unsigned short buttons = 0; // struct Spw_IntPacket packet; diff --git a/rott/rt_net.c b/rott/rt_net.c index 4a4bf2c..a766a41 100644 --- a/rott/rt_net.c +++ b/rott/rt_net.c @@ -2008,22 +2008,22 @@ int SetupCheckForPacket ( void ) break; case COM_GAMEDESC: if (standalone==true) - printf("Received GameDescription from player#%ld\n",(long int)rottcom->remotenode); + printf("Received GameDescription from player#%ld\n",(long)rottcom->remotenode); WritePacket(&ROTTpacket[0],GetPacketSize(pkt),0); // Send to player 0 break; case COM_GAMEACK: if (standalone==true) - printf("Received GameAcknowledgement from player#%ld\n",(long int)rottcom->remotenode); + printf("Received GameAcknowledgement from player#%ld\n",(long)rottcom->remotenode); WritePacket(&ROTTpacket[0],GetPacketSize(pkt),0); // Send to player 0 break; case COM_GAMEMASTER: if (standalone==true) - printf("Received GameMasterPacket from player#%ld\n",(long int)rottcom->remotenode); + printf("Received GameMasterPacket from player#%ld\n",(long)rottcom->remotenode); BroadcastServerPacket(&ROTTpacket[0],GetPacketSize(pkt)); // Send to all break; case COM_GAMEPLAY: if (standalone==true) - printf("Received StartGamePacket from player#%ld\n",(long int)rottcom->remotenode); + printf("Received StartGamePacket from player#%ld\n",(long)rottcom->remotenode); BroadcastServerPacket(&ROTTpacket[0],GetPacketSize(pkt)); // Send to all retval=scfp_done; break; @@ -2468,7 +2468,7 @@ void SendGameDescription( void ) void SetGameDescription( void * pkt ) { COM_GameMasterType * desc; - word localcrc; + unsigned short localcrc; int i; desc=(COM_GameMasterType *)pkt; diff --git a/rott/rt_net.h b/rott/rt_net.h index 576ce99..bbbb25c 100644 --- a/rott/rt_net.h +++ b/rott/rt_net.h @@ -81,8 +81,8 @@ typedef struct DemoType { int time; short momx; short momy; - word dangle; - word buttons; + unsigned short dangle; + unsigned short buttons; } DemoType; // Demo Header Structure @@ -96,8 +96,8 @@ typedef struct MoveType { int time; short momx; short momy; - word dangle; - word buttons; + unsigned short dangle; + unsigned short buttons; char Sounddata[0]; } MoveType; @@ -139,8 +139,8 @@ typedef struct { int x; int y; int z; - word angle; - word randomindex; + unsigned short angle; + unsigned short randomindex; } COM_CheckSyncType; typedef struct { @@ -207,7 +207,7 @@ typedef struct { byte player; // which player byte violence; byte Product; - unsigned Version; + unsigned int Version; COM_PlayerDescriptionType playerdescription; } COM_GamePlayerType; @@ -215,11 +215,11 @@ typedef struct { typedef struct { byte type; byte level; - word mapcrc; + unsigned short mapcrc; byte violence; byte Product; byte mode; - unsigned Version; + unsigned int Version; boolean teamplay; specials SpecialsTimes; battle_type options; diff --git a/rott/rt_playr.h b/rott/rt_playr.h index a18a164..fb6d673 100644 --- a/rott/rt_playr.h +++ b/rott/rt_playr.h @@ -126,7 +126,7 @@ typedef struct signed short heightoffset; signed short weaponheight; byte weaponx,weapony; - word batblast; + unsigned short batblast; signed char NETCAPTURED; signed char HASKNIFE; int oldweapon, oldmissileweapon; diff --git a/rott/rt_scale.c b/rott/rt_scale.c index ddd552c..eeb4840 100644 --- a/rott/rt_scale.c +++ b/rott/rt_scale.c @@ -413,7 +413,7 @@ void ScaleShape (visobj_t * sprite) } // dc_iscale=(1<<(16+6+HEIGHTFRACTION+size))/sprite->viewheight; - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=(((sprite->h1<topoffset)<>1); sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale); shadingtable=sprite->colormap; @@ -562,7 +562,7 @@ void ScaleTransparentShape (visobj_t * sprite) } // dc_iscale=(1<<(16+6+HEIGHTFRACTION+size))/sprite->viewheight; - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=(((sprite->h1<topoffset)<>1); sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale); shadingtable=sprite->colormap; @@ -636,7 +636,7 @@ void ScaleSolidShape (visobj_t * sprite) } // dc_iscale=(1<<(16+6+HEIGHTFRACTION+size))/sprite->viewheight; - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=(((sprite->h1<topoffset)<>1); sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale); shadingtable=sprite->colormap; @@ -711,7 +711,7 @@ void ScaleWeapon (int xoff, int y, int shapenum) if (x2 < 0) return; // off the left side - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=(((p->origsize>>1)+p->topoffset)<>2); sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale); @@ -875,7 +875,7 @@ void DrawPositionedScaledSprite (int x, int y, int shapenum, int height, int typ if (x2 < 0) return; // off the left side - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; // dc_iscale=(1<<(16+6+size))/height; dc_texturemid=(((32<topoffset)<>1); sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale); @@ -959,7 +959,7 @@ void DrawScreenSizedSprite (int lump) return; // off the left side } - dc_iscale=0xffffffffu/(unsigned)dc_invscale; + dc_iscale=0xffffffffu/(unsigned int)dc_invscale; dc_texturemid=(((p->origsize>>1) + p->topoffset)<>1); sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale); @@ -1140,7 +1140,7 @@ void R_DrawWallColumn (byte * buf) while (count--) { //*dest = 6; - *dest = shadingtable[dc_source[(((unsigned)frac)>>26)]]; + *dest = shadingtable[dc_source[(((unsigned int)frac)>>26)]]; dest += iGLOBAL_SCREENWIDTH; frac += fracstep; } @@ -1164,7 +1164,7 @@ void R_DrawClippedColumn (byte * buf) frac = dc_texturemid + (dc_yl-centeryclipped)*fracstep; while (count--) { - *dest = shadingtable[dc_source[(((unsigned)frac)>>SFRACBITS)]]; + *dest = shadingtable[dc_source[(((unsigned int)frac)>>SFRACBITS)]]; dest += iGLOBAL_SCREENWIDTH; frac += fracstep; } diff --git a/rott/rt_stat.h b/rott/rt_stat.h index 18fb7a8..3ca4baa 100644 --- a/rott/rt_stat.h +++ b/rott/rt_stat.h @@ -140,16 +140,16 @@ typedef struct statstruct byte tilex,tiley; fixed x,y,z; int shapenum; - unsigned flags; + unsigned int flags; signed char ticcount; signed char ammo; byte *visspot; signed char count; byte numanims; stat_t itemnumber; - short int hitpoints; - short int whichstat; - short int areanumber; + short hitpoints; + short whichstat; + short areanumber; intptr_t linked_to; struct statstruct *statnext; @@ -176,7 +176,7 @@ typedef struct short heightoffset; int picnum; stat_t type; - unsigned flags; + unsigned int flags; byte tictime; byte numanims; byte hitpoints; diff --git a/rott/rt_str.c b/rott/rt_str.c index fba549d..fafd002 100644 --- a/rott/rt_str.c +++ b/rott/rt_str.c @@ -488,11 +488,11 @@ void US_BufPrint (const char *string) //****************************************************************************** // -// US_PrintUnsigned () - Prints an unsigned long int +// US_PrintUnsigned () - Prints an unsigned long // //****************************************************************************** -void US_PrintUnsigned (unsigned long int n) +void US_PrintUnsigned (unsigned long n) { char buffer[32]; @@ -505,7 +505,7 @@ void US_PrintUnsigned (unsigned long int n) // //****************************************************************************** -void US_PrintSigned (long int n) +void US_PrintSigned (long n) { char buffer[32]; @@ -1383,8 +1383,8 @@ void US_CenterWindow (int w, int h) // // TEXT FORMATTING COMMANDS - (Use EGA colors ONLY!) // ------------------------------------------------- -// / - Change the following word to color -// ` - Highlights the following word with lighter color of fontcolor +// / - Change the following unsigned short to color +// ` - Highlights the following unsigned short with lighter color of fontcolor // /N - Change the fontcolor to a certain color // //============================================================================== @@ -1510,7 +1510,7 @@ int GetColor (int num) static int oldfontcolor = 0; static boolean highlight = false; -void DrawIString (unsigned short int x, unsigned short int y, const char *string, int flags) +void DrawIString (unsigned short x, unsigned short y, const char *string, int flags) { char ch; char temp; @@ -1522,7 +1522,7 @@ void DrawIString (unsigned short int x, unsigned short int y, const char *string { if ( !PERMANENT_MSG( flags ) ) { - // Highlighting is done only for 1 word - if we get a "space" + // Highlighting is done only for 1 unsigned short - if we get a "space" // and highlight is on ...., reset variables. // if ((ch == ' ') && (highlight == true)) @@ -1609,7 +1609,7 @@ void DrawIString (unsigned short int x, unsigned short int y, const char *string // //****************************************************************************** -void DrawIntensityString (unsigned short int x, unsigned short int y, const char *string, int color) +void DrawIntensityString (unsigned short x, unsigned short y, const char *string, int color) { char ch; diff --git a/rott/rt_str.h b/rott/rt_str.h index 30a28b4..9a2b5b7 100644 --- a/rott/rt_str.h +++ b/rott/rt_str.h @@ -86,8 +86,8 @@ void US_SetPrintRoutines (void (*measure)(const char *, int *, int *, font_t *), void (*print)(const char *)); void US_Print (const char *s); void US_BufPrint (const char *s); -void US_PrintUnsigned (unsigned long int n); -void US_PrintSigned (long int n); +void US_PrintUnsigned (unsigned long n); +void US_PrintSigned (long n); void USL_PrintInCenter (const char *s, Rect r); void US_PrintCentered (const char *s); void US_CPrintLine (const char *s); @@ -115,8 +115,8 @@ void US_CenterWindow (int w, int h); // Intensity font rtns // -void DrawIString (unsigned short int x, unsigned short int y, const char *string, int flags); -void DrawIntensityString (unsigned short int x, unsigned short int y, const char *string, int color); +void DrawIString (unsigned short x, unsigned short y, const char *string, int flags); +void DrawIntensityString (unsigned short x, unsigned short y, const char *string, int color); void VW_MeasureIntensityPropString (const char *string, int *width, int *height); byte GetIntensityColor (byte pix); diff --git a/rott/rt_ted.c b/rott/rt_ted.c index 63587ee..04fb8f0 100644 --- a/rott/rt_ted.c +++ b/rott/rt_ted.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - // make sure word alignment is OFF! + // make sure unsigned short alignment is OFF! #include "rt_def.h" #include "rt_sound.h" @@ -87,7 +87,7 @@ int lightsource; int SNAKELEVEL; int whichpath; -word *mapplanes[3]; +unsigned short *mapplanes[3]; int mapwidth; int mapheight; int lastlevelloaded=-1; @@ -95,7 +95,7 @@ int lastlevelloaded=-1; boolean insetupgame; boolean ISRTL = false; -unsigned MapSpecials = 0; +unsigned int MapSpecials = 0; char LevelName[80]; @@ -104,7 +104,7 @@ char LevelName[80]; //======================================== static cachetype * cachelist; -static word cacheindex; +static unsigned short cacheindex; static boolean CachingStarted=false; char * ROTTMAPS; char * BATTMAPS; @@ -1233,10 +1233,10 @@ DisableScreenStretch(); ====================== */ -void CA_RLEWexpand (word *source, word *dest,long length, unsigned rlewtag) +void CA_RLEWexpand (unsigned short *source, unsigned short *dest,long length, unsigned int rlewtag) { - word value,count,i; - word *end; + unsigned short value,count,i; + unsigned short *end; end = dest + length; // @@ -1483,10 +1483,10 @@ void ReadROTTMap // unRLEW, skipping expanded length // #if ( SHAREWARE == 1 ) - CA_RLEWexpand( ( word * )buffer, ( word * )mapplanes[ plane ], + CA_RLEWexpand( ( unsigned short * )buffer, ( unsigned short * )mapplanes[ plane ], expanded >> 1, SHAREWARE_TAG ); #else - CA_RLEWexpand( ( word * )buffer, ( word * )mapplanes[ plane ], + CA_RLEWexpand( ( unsigned short * )buffer, ( unsigned short * )mapplanes[ plane ], expanded >> 1, RTLMap.RLEWtag ); #endif @@ -1511,8 +1511,8 @@ void ReadROTTMap */ int GetNextMap ( int tilex, int tiley ) { - word next; - word icon; + unsigned short next; + unsigned short icon; boolean done; next = MAPSPOT( tilex, tiley, 2 ); @@ -1661,7 +1661,7 @@ void SetBattleMapFileName ( char * filename ) = ====================== */ -word GetMapCRC +unsigned short GetMapCRC ( int num ) @@ -1771,7 +1771,7 @@ void LoadTedMap LoadFile( name, ( void * )&tinf ); // fix structure alignment - tinf = ( void * )( ( word * )tinf - 1 ); + tinf = ( void * )( ( unsigned short * )tinf - 1 ); for( i = 0 ; i < 100 ; i++ ) { @@ -1833,14 +1833,14 @@ void LoadTedMap // // unRLEW, skipping expanded length // - CA_RLEWexpand( ( word * )( buffer + 2 ), ( word * )mapplanes[ plane ], + CA_RLEWexpand( ( unsigned short * )( buffer + 2 ), ( unsigned short * )mapplanes[ plane ], expanded >> 1, 0xabcd ); SafeFree( buffer ); } // fix structure alignment - tinf = ( void * )( ( word * )tinf + 1 ); + tinf = ( void * )( ( unsigned short * )tinf + 1 ); SafeFree( tinf ); @@ -1907,7 +1907,7 @@ void LoadROTTMap void CountAreaTiles(void) {int i,j,areanumber; - word*map,tile; + unsigned short*map,tile; memset(numareatiles,0,sizeof(numareatiles)); map = mapplanes[0]; @@ -1948,7 +1948,7 @@ void CountAreaTiles(void) void SetupWalls( void ) { int i,j,lump,index; - word *map,tile; + unsigned short *map,tile; wall_t * tempwall; @@ -2032,7 +2032,7 @@ void SetupWalls( void ) = =============== */ -word GetNearestAreaNumber ( int tilex, int tiley ) +unsigned short GetNearestAreaNumber ( int tilex, int tiley ) { int up,dn,lt,rt; int tile; @@ -2096,7 +2096,7 @@ void SetupWindows ( void ) { MAPSPOT(i,j,2)=0; } - MAPSPOT(i,j,0)=(word)(GetNearestAreaNumber(i,j)); + MAPSPOT(i,j,0)=(unsigned short)(GetNearestAreaNumber(i,j)); } } } @@ -2187,7 +2187,7 @@ int GetWallIndex( int texture ) void SetupAnimatedWalls( void ) { int i,j; - word *map,tile; + unsigned short *map,tile; wall_t * tempwall; InitAnimatedWallList(); @@ -2271,7 +2271,7 @@ void SetupAnimatedWalls( void ) void SetupSwitches( void ) { int i,j; - word *map,tile; + unsigned short *map,tile; map = mapplanes[0]; for (j=0;j> 8) & 0xff); - touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT(i,j,2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT(i,j,2) >> 0) & 0xff); if (touchindices[touchx][touchy]) { if (MAPSPOT(i,j+1,2)!=0) @@ -3023,8 +3023,8 @@ void SetupPushWallLinks( void ) { if (MAPSPOT(i,j,2)) { - touchx = (word) ((MAPSPOT(i,j,2) >> 8) & 0xff); - touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT(i,j,2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT(i,j,2) >> 0) & 0xff); if (touchindices[touchx][touchy]) { if (MAPSPOT(i,j+1,2)!=0) @@ -3047,8 +3047,8 @@ void SetupPushWallLinks( void ) { if (MAPSPOT(i,j,2)) { - touchx = (word) ((MAPSPOT(i,j,2) >> 8) & 0xff); - touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT(i,j,2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT(i,j,2) >> 0) & 0xff); if (touchindices[touchx][touchy]) { if (MAPSPOT(i,j+1,2)!=0) @@ -3078,8 +3078,8 @@ void SetupPushWallLinks( void ) void SetupElevators (void) { int j, i,x,y,starti; - word *map; - word tile; + unsigned short *map; + unsigned short tile; elevator_t *elev; doorobj_t* dptr; @@ -3195,8 +3195,8 @@ void SetupElevators (void) void SetupDoors (void) { int j, i; - word *map; - word tile; + unsigned short *map; + unsigned short tile; byte locked; map = mapplanes[0]; @@ -3289,11 +3289,11 @@ void SetupDoorLinks (void) int j, i, k; - word *map; + unsigned short *map; int clocklinked; int clockx,clocky; int doornumber; - word touchx, + unsigned short touchx, touchy; map = mapplanes[0]; @@ -3327,8 +3327,8 @@ void SetupDoorLinks (void) if (!clocklinked) { - touchx = (word) ((MAPSPOT (i, j, 2) >> 8) & 0xff); - touchy = (word) ((MAPSPOT (i, j, 2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT (i, j, 2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT (i, j, 2) >> 0) & 0xff); if (touchindices[touchx][touchy]) { @@ -3402,7 +3402,7 @@ void SetupClocks (void) minutes, seconds, starti; - word *map, + unsigned short *map, tile, mapx, mapy; @@ -3426,8 +3426,8 @@ void SetupClocks (void) if (tile == 121) { - mapx = (word) ((MAPSPOT (i, j, 2) >> 8) & 0xff); - mapy = (word) ((MAPSPOT (i, j, 2) >> 0) & 0xff); + mapx = (unsigned short) ((MAPSPOT (i, j, 2) >> 8) & 0xff); + mapy = (unsigned short) ((MAPSPOT (i, j, 2) >> 0) & 0xff); minutes = (int) ((MAPSPOT (mapx, mapy, 2) >> 8) & 0xff); seconds = (int) ((MAPSPOT (mapx, mapy, 2) >> 0) & 0xff); @@ -3559,7 +3559,7 @@ void LinkActor (objtype *ob,int tilex,int tiley, void (*action)(intptr_t),void (*swapaction)(intptr_t) ) { - word touchx,touchy; + unsigned short touchx,touchy; int clockx,clocky; int clocklinked,k; wall_t * tswitch; @@ -3579,8 +3579,8 @@ void LinkActor (objtype *ob,int tilex,int tiley, if (!clocklinked) { - touchx = (word) ((MAPSPOT(tilex,tiley,2) >> 8) & 0xff); - touchy = (word) ((MAPSPOT(tilex,tiley,2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT(tilex,tiley,2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT(tilex,tiley,2) >> 0) & 0xff); if ((MISCVARS->TOMLOC.x == touchx) && (MISCVARS->TOMLOC.y == touchy)) { objtype *tom = (objtype*)actorat[touchx][touchy]; @@ -3632,7 +3632,7 @@ void LinkActor (objtype *ob,int tilex,int tiley, void SetupInanimateActors (void) { int i,j,linked; - word *map,tile; + unsigned short *map,tile; void (*action)(intptr_t),(*swapaction)(intptr_t); @@ -3927,7 +3927,7 @@ void SetupInanimateActors (void) void FixTiles(void) { - word *map,tile; + unsigned short *map,tile; int i,j; map = mapplanes[1]; @@ -3979,7 +3979,7 @@ void SetupLights(void) { int i,j,touchx,touchy; wall_t *tswitch; - word *map,tile; + unsigned short *map,tile; int starti; // Initialize Lights in Area @@ -4021,8 +4021,8 @@ void SetupLights(void) case 43: if (MAPSPOT(i,j,2)) { - touchx = (word) ((MAPSPOT(i,j,2) >> 8) & 0xff); - touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff); + touchx = (unsigned short) ((MAPSPOT(i,j,2) >> 8) & 0xff); + touchy = (unsigned short) ((MAPSPOT(i,j,2) >> 0) & 0xff); tswitch = (wall_t*) actorat[touchx][touchy]; if (tswitch && (tswitch->which == WALL)) @@ -4229,7 +4229,7 @@ int GetLumpForTile(int tile) void PrintTileStats (void) { int i,j; - word *map; + unsigned short *map; int easytotal; int hardtotal; int tally[1000]; @@ -4696,7 +4696,7 @@ int GetSongForLevel ( void ) void DoSharewareConversionBackgroundPlane (void) { int i,j; - word * map; + unsigned short * map; for (j=0;j=90) && (crud<=97)) { levelheight=crud-89; @@ -5223,7 +5223,7 @@ void SetupSnakePath(void) { #if (SHAREWARE == 0) int i,j; - word *map,tile; + unsigned short *map,tile; map = mapplanes[1]; @@ -5243,7 +5243,7 @@ void SetupSnakePath(void) void SetupRandomActors(void) {int i,j; - word *map,tile; + unsigned short *map,tile; int starti,totalrandom=0,count=0,ambush,locindex,orig; byte actorpresent[10]={0},index=0,randomtype,used[100]={0}; _2Dpoint randloc[100]; @@ -5318,7 +5318,7 @@ void SetupRandomActors(void) void SetupActors(void) { int i,j; - word *map,tile; + unsigned short *map,tile; int starti; @@ -5788,7 +5788,7 @@ void SetupActors(void) void SetupStatics(void) { int i,j,spawnz; - word *map,tile; + unsigned short *map,tile; int starti; map = mapplanes[1]; diff --git a/rott/rt_ted.h b/rott/rt_ted.h index ff84877..0b28cbe 100644 --- a/rott/rt_ted.h +++ b/rott/rt_ted.h @@ -63,7 +63,7 @@ typedef struct { thingtype which; byte flags; byte hitpoints; - word tile; + unsigned short tile; byte tilex,tiley; @@ -90,12 +90,12 @@ typedef struct typedef struct { - unsigned used; - unsigned CRC; - unsigned RLEWtag; - unsigned MapSpecials; - unsigned planestart[ NUMPLANES ]; - unsigned planelength[ NUMPLANES ]; + unsigned int used; + unsigned int CRC; + unsigned int RLEWtag; + unsigned int MapSpecials; + unsigned int planestart[ NUMPLANES ]; + unsigned int planelength[ NUMPLANES ]; char Name[ ALLOCATEDLEVELNAMELENGTH ]; } RTLMAP; @@ -125,9 +125,9 @@ extern wall_t walls[MAXWALLTILES]; extern str_clock Clocks[MAXCLOCKS]; extern int LightsInArea[NUMAREAS+1]; extern int numclocks; -extern word ELEVATORLOCATION; +extern unsigned short ELEVATORLOCATION; -extern unsigned short int *mapplanes[3]; +extern unsigned short *mapplanes[3]; extern int gunsstart; extern int elevatorstart; extern int spritestop; @@ -170,7 +170,7 @@ void PrintTileStats (void); void GetMapInfo (mapfileinfo_t * mapinfo); void GetMapFileName ( char * filename ); void SetBattleMapFileName ( char * filename ); -word GetMapCRC ( int num ); +unsigned short GetMapCRC ( int num ); int GetNextMap ( int tilex, int tiley ); void Illuminate(); diff --git a/rott/rt_util.c b/rott/rt_util.c index 6f3f33b..04ba739 100644 --- a/rott/rt_util.c +++ b/rott/rt_util.c @@ -355,18 +355,18 @@ void Error (char *error, ...) if (player!=NULL) { - printf ("Player X = %lx\n", (long int)player->x); - printf ("Player Y = %lx\n", (long int)player->y); - printf ("Player Angle = %lx\n\n", (long int)player->angle); + printf ("Player X = %lx\n", (long)player->x); + printf ("Player Y = %lx\n", (long)player->y); + printf ("Player Angle = %lx\n\n", (long)player->angle); } - printf ("Episode = %ld\n", (long int)gamestate.episode); + printf ("Episode = %ld\n", (long)gamestate.episode); if (gamestate.episode > 1) level = (gamestate.mapon+1) - ((gamestate.episode-1) << 3); else level = gamestate.mapon+1; - printf ("Area = %ld\n", (long int)level); + printf ("Area = %ld\n", (long)level); ShutDown(); // DDOI - moved this so that it doesn't try to access player // which is freed by this function. @@ -602,7 +602,7 @@ int SafeOpenRead (char *_filename) void SafeRead (int handle, void *buffer, long count) { - unsigned iocount; + unsigned int iocount; while (count) { @@ -617,7 +617,7 @@ void SafeRead (int handle, void *buffer, long count) void SafeWrite (int handle, void *buffer, long count) { - unsigned iocount; + unsigned int iocount; while (count) { @@ -631,7 +631,7 @@ void SafeWrite (int handle, void *buffer, long count) void SafeWriteString (int handle, char * buffer) { - unsigned iocount; + unsigned int iocount; iocount=strlen(buffer); if (write (handle,buffer,iocount) != (int)iocount) diff --git a/rott/rt_vid.c b/rott/rt_vid.c index 04ff43c..6b170da 100644 --- a/rott/rt_vid.c +++ b/rott/rt_vid.c @@ -49,9 +49,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //****************************************************************************** byte *updateptr; -unsigned mapwidthtable[64]; -unsigned uwidthtable[UPDATEHIGH]; -unsigned blockstarts[UPDATEWIDE*UPDATEHIGH]; +unsigned int mapwidthtable[64]; +unsigned int uwidthtable[UPDATEHIGH]; +unsigned int blockstarts[UPDATEWIDE*UPDATEHIGH]; byte update[UPDATESIZE]; byte palette1[256][3], palette2[256][3]; boolean screenfaded; @@ -328,7 +328,7 @@ void VWB_TBar (int x, int y, int width, int height) // //****************************************************************************** -void VL_Hlin (unsigned x, unsigned y, unsigned width, unsigned color) +void VL_Hlin (unsigned int x, unsigned int y, unsigned int width, unsigned int color) { byte *dest = (byte*)(bufferofs+ylookup[y]+x); @@ -389,7 +389,7 @@ void VWB_Vlin (int y1, int y2, int x, int color) // //****************************************************************************** -void VL_THlin (unsigned x, unsigned y, unsigned width, boolean up) +void VL_THlin (unsigned int x, unsigned int y, unsigned int width, boolean up) { byte *dest = (byte*)(bufferofs+ylookup[y]+x); @@ -416,7 +416,7 @@ void VL_THlin (unsigned x, unsigned y, unsigned width, boolean up) // //****************************************************************************** -void VL_TVlin (unsigned x, unsigned y, unsigned height, boolean up) +void VL_TVlin (unsigned int x, unsigned int y, unsigned int height, boolean up) { byte *dest = (byte*)(bufferofs+ylookup[y]+x); diff --git a/rott/rt_vid.h b/rott/rt_vid.h index 154f25e..e01faf6 100644 --- a/rott/rt_vid.h +++ b/rott/rt_vid.h @@ -49,9 +49,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //*************************************************************************** extern byte *updateptr; -extern unsigned mapwidthtable[64]; -extern unsigned uwidthtable[UPDATEHIGH]; -extern unsigned blockstarts[UPDATEWIDE*UPDATEHIGH]; +extern unsigned int mapwidthtable[64]; +extern unsigned int uwidthtable[UPDATEHIGH]; +extern unsigned int blockstarts[UPDATEWIDE*UPDATEHIGH]; extern byte update[UPDATESIZE]; extern boolean screenfaded; diff --git a/rott/rt_view.c b/rott/rt_view.c index 9338b34..32b39d4 100644 --- a/rott/rt_view.c +++ b/rott/rt_view.c @@ -67,7 +67,7 @@ int baseminshade; int basemaxshade; int viewheight; int viewwidth; -longword heightnumerator; +unsigned int heightnumerator; fixed scale; int screenofs; int centerx; @@ -517,11 +517,11 @@ void SetupLightLevels ( void ) // Set up light level for level - if (((word)MAPSPOT(2,0,1)>=104) && ((word)MAPSPOT(2,0,1)<=105)) - fog=(word)MAPSPOT(2,0,1)-104; + if (((unsigned short)MAPSPOT(2,0,1)>=104) && ((unsigned short)MAPSPOT(2,0,1)<=105)) + fog=(unsigned short)MAPSPOT(2,0,1)-104; else Error ("There is no Fog icon on map %d\n",gamestate.mapon); - if ((word)MAPSPOT(3,0,1)==139) + if ((unsigned short)MAPSPOT(3,0,1)==139) { if (fog==0) { @@ -532,16 +532,16 @@ void SetupLightLevels ( void ) else Error("You cannot use light sourcing on a level with fog on map %d\n",gamestate.mapon); } - else if ((word)MAPSPOT(3,0,1)) + else if ((unsigned short)MAPSPOT(3,0,1)) Error("You must use the lightsource icon or nothing at all at (3,0) in plane 1 on map %d\n",gamestate.mapon); - if (((word)MAPSPOT(2,0,0)>=LIGHTLEVELBASE) && ((word)MAPSPOT(2,0,0)<=LIGHTLEVELEND)) + if (((unsigned short)MAPSPOT(2,0,0)>=LIGHTLEVELBASE) && ((unsigned short)MAPSPOT(2,0,0)<=LIGHTLEVELEND)) glevel=(MAPSPOT(2,0,0)-LIGHTLEVELBASE); else Error("You must specify a valid darkness level icon at (2,0) on map %d\n",gamestate.mapon); SetLightLevels ( glevel ); - if (((word)MAPSPOT(3,0,0)>=LIGHTRATEBASE) && ((word)MAPSPOT(3,0,0)<=LIGHTRATEEND)) + if (((unsigned short)MAPSPOT(3,0,0)>=LIGHTRATEBASE) && ((unsigned short)MAPSPOT(3,0,0)<=LIGHTRATEEND)) glevel=(MAPSPOT(3,0,0)-LIGHTRATEBASE); else { @@ -818,42 +818,42 @@ void SetModemLightLevel ( int type ) switch (type) { case bo_light_dark: - MAPSPOT(2,0,0)=(word)216; - MAPSPOT(3,0,0)=(word)255; - MAPSPOT(3,0,1)=(word)139; - MAPSPOT(2,0,1)=(word)104; + MAPSPOT(2,0,0)=(unsigned short)216; + MAPSPOT(3,0,0)=(unsigned short)255; + MAPSPOT(3,0,1)=(unsigned short)139; + MAPSPOT(2,0,1)=(unsigned short)104; SetupLightLevels (); break; case bo_light_normal: break; case bo_light_bright: - MAPSPOT(2,0,0)=(word)223; - MAPSPOT(3,0,0)=(word)267; - MAPSPOT(3,0,1)=(word)0; - MAPSPOT(2,0,1)=(word)104; + MAPSPOT(2,0,0)=(unsigned short)223; + MAPSPOT(3,0,0)=(unsigned short)267; + MAPSPOT(3,0,1)=(unsigned short)0; + MAPSPOT(2,0,1)=(unsigned short)104; SetupLightLevels (); break; case bo_light_fog: - MAPSPOT(2,0,0)=(word)219; - MAPSPOT(3,0,0)=(word)259; - MAPSPOT(2,0,1)=(word)105; - MAPSPOT(3,0,1)=(word)0; + MAPSPOT(2,0,0)=(unsigned short)219; + MAPSPOT(3,0,0)=(unsigned short)259; + MAPSPOT(2,0,1)=(unsigned short)105; + MAPSPOT(3,0,1)=(unsigned short)0; SetupLightLevels (); break; case bo_light_periodic: fog=0; - MAPSPOT(2,0,1)=(word)104; - MAPSPOT(3,0,1)=(word)139; + MAPSPOT(2,0,1)=(unsigned short)104; + MAPSPOT(3,0,1)=(unsigned short)139; SetupLightLevels (); periodic=true; break; case bo_light_lightning: if (sky!=0) { - MAPSPOT(2,0,0)=(word)222; - MAPSPOT(3,0,0)=(word)255; - MAPSPOT(3,0,1)=(word)139; - MAPSPOT(2,0,1)=(word)104; + MAPSPOT(2,0,0)=(unsigned short)222; + MAPSPOT(3,0,0)=(unsigned short)255; + MAPSPOT(3,0,1)=(unsigned short)139; + MAPSPOT(2,0,1)=(unsigned short)104; SetupLightLevels (); lightning=true; } diff --git a/rott/rt_view.h b/rott/rt_view.h index 92a98f5..20669ea 100644 --- a/rott/rt_view.h +++ b/rott/rt_view.h @@ -92,7 +92,7 @@ extern int baseminshade; extern int basemaxshade; extern int viewheight; extern int viewwidth; -extern longword heightnumerator; +extern unsigned int heightnumerator; extern fixed scale; extern int screenofs; extern int centerx; diff --git a/rott/w_wad.c b/rott/w_wad.c index 0e217a8..91158b9 100644 --- a/rott/w_wad.c +++ b/rott/w_wad.c @@ -72,7 +72,7 @@ void W_AddFile (char *_filename) { wadinfo_t header; lumpinfo_t *lump_p; - unsigned i; + unsigned int i; int handle, length; int startlump; filelump_t *fileinfo, singleinfo; @@ -211,7 +211,7 @@ void W_InitMultipleFiles (char **filenames) Error("W_InitFiles: lumpcache malloc failed size=%d\n",numlumps<<2); if (!quiet) - printf("W_Wad: Wad Manager Started NUMLUMPS=%ld\n",(long int)numlumps); + printf("W_Wad: Wad Manager Started NUMLUMPS=%ld\n",(long)numlumps); W_CheckWADIntegrity (); } diff --git a/rott/z_zone.c b/rott/z_zone.c index 59b494d..e1add77 100644 --- a/rott/z_zone.c +++ b/rott/z_zone.c @@ -36,7 +36,7 @@ typedef struct memblock { struct memblock *next,*prev; size_t size; void **user; - unsigned id; + unsigned int id; pu_tag tag; } memblock_t;