Split r3159..r3161, part 12: Add explicit casts, non-pointer types.

Notes:
 - Atomic Edition (Censored) -> Plutonium Pak in grpscan.c
 - "scale" in astub.c:drawtileinfo() is incorrect, I think.
 - in demo.c, the gethitickms() value should be returned to a double.

git-svn-id: https://svn.eduke32.com/eduke32@3178 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-15 14:28:41 +00:00
parent 61d038f217
commit 107fa9cc39
11 changed files with 47 additions and 46 deletions

View File

@ -2181,7 +2181,7 @@ void fade_editor_screen(int32_t keepcol)
{
char blackcol=0, greycol=whitecol-25, *cp;
int32_t pix, i, threecols = (keepcol >= 256);
char cols[3] = {keepcol&0xff, (keepcol>>8)&0xff, (keepcol>>16)&0xff};
char cols[3] = {(char)(keepcol&0xff), (char)((keepcol>>8)&0xff), (char)((keepcol>>16)&0xff)};
begindrawing();
cp = (char *)frameplace;
@ -4221,7 +4221,7 @@ rotate_hlsect_out:
// ^ |
// minfloorz ---|
ulz[0] = oldfz - swsecheight*((double)(oldfz-maxceilz)/(minfloorz-maxceilz));
ulz[0] = (int32_t)(oldfz - swsecheight*((double)(oldfz-maxceilz)/(minfloorz-maxceilz)));
ulz[0] &= ~255;
ulz[1] = ulz[0] + swsecheight;

View File

@ -7577,14 +7577,14 @@ static int32_t loadtables(void)
reciptable[i] = divscale30(2048, i+2048);
for (i=0; i<=512; i++)
sintable[i] = 16384*sin(i*BANG2RAD);
sintable[i] = (int16_t)(16384*sin(i*BANG2RAD));
for (i=513; i<1024; i++)
sintable[i] = sintable[1024-i];
for (i=1024; i<2048; i++)
sintable[i] = -sintable[i-1024];
for (i=0; i<640; i++)
radarang[i] = -64*atan((640-0.5-i)/160)/BANG2RAD;
radarang[i] = (int16_t)(-64*atan((640-0.5-i)/160)/BANG2RAD);
for (i=0; i<640; i++)
radarang[1279-i] = -radarang[i];

View File

@ -125,7 +125,7 @@ static const int32_t pow2long[32] =
0x00010000,0x00020000,0x00040000,0x00080000,
0x00100000,0x00200000,0x00400000,0x00800000,
0x01000000,0x02000000,0x04000000,0x08000000,
0x10000000,0x20000000,0x40000000,0x80000000,
0x10000000,0x20000000,0x40000000,(int32_t)0x80000000,
};
//Hack for peekbits,getbits,suckbits (to prevent lots of duplicate code)

View File

@ -1171,7 +1171,7 @@ void polymer_editorpick(void)
GLfloat dadepth;
int16_t k, bestk=0;
GLfloat bestwdistsq = 3.4e38, wdistsq;
GLfloat bestwdistsq = (GLfloat)3.4e38, wdistsq;
GLfloat w1[2], w2[2], w21[2], pw1[2], pw2[2];
GLfloat ptonline[2];
GLfloat scrvxz[2];
@ -2356,9 +2356,9 @@ static int32_t polymer_updatesector(int16_t sectnum)
heidiff = (int32_t)(curbuffer[(i*5)+1] - curbuffer[1]);
// don't forget the sign, tey could be negative with concave sectors
if (tey >= 0)
tey = (int32_t)sqrt((tey * tey) + (heidiff * heidiff));
tey = (int32_t)sqrt((double)((tey * tey) + (heidiff * heidiff)));
else
tey = -(int32_t)sqrt((tey * tey) + (heidiff * heidiff));
tey = -(int32_t)sqrt((double)((tey * tey) + (heidiff * heidiff)));
}
if (curstat & 4)

View File

@ -371,7 +371,7 @@ void clearbufbyte(void *D, int32_t c, int32_t a)
{
// Cringe City
char *p = (char *)D;
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,(int32_t)0xff000000l };
int32_t n[4] = { 0,8,16,24 };
int32_t z=0;
while ((c--) > 0)

View File

@ -7760,7 +7760,7 @@ static void G_DoEffectorLights(void) // STATNUM 14
actor[i].lightptr->color[1] = sprite[i].yvel;
actor[i].lightptr->color[2] = sprite[i].zvel;
}
if (!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
if ((int)!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
actor[i].lightptr->publicflags.negative = !!(CS & 128);
}
}
@ -7850,10 +7850,10 @@ static void G_DoEffectorLights(void) // STATNUM 14
actor[i].lightptr->horiz = SH;
actor[i].lightptr->flags.invalidate = 1;
}
if (!(CS & 64) != actor[i].lightptr->publicflags.emitshadow) {
if ((int)!(CS & 64) != actor[i].lightptr->publicflags.emitshadow) {
actor[i].lightptr->publicflags.emitshadow = !(CS & 64);
}
if (!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
if ((int)!!(CS & 128) != actor[i].lightptr->publicflags.negative) {
actor[i].lightptr->publicflags.negative = !!(CS & 128);
}
actor[i].lightptr->tilenum = actor[i].picnum;

View File

@ -1350,8 +1350,8 @@ const char *ExtGetWallCaption(int16_t wallnum)
int32_t lt = taglab_linktags(0, wallnum);
char histr[TAGLAB_MAX+16], lostr[TAGLAB_MAX+16];
lt &= ~(wall[wallnum].lotag<=0);
lt &= ~((wall[wallnum].hitag<=0)<<1);
lt &= ~(int)(wall[wallnum].lotag<=0);
lt &= ~(int)((wall[wallnum].hitag<=0)<<1);
taglab_handle1(lt&2, wall[wallnum].hitag, histr);
@ -1491,8 +1491,8 @@ const char *ExtGetSpriteCaption(int16_t spritenum)
return tempbuf;
lt = taglab_linktags(1, spritenum);
lt &= ~(sprite[spritenum].lotag<=0);
lt &= ~((sprite[spritenum].hitag<=0)<<1);
lt &= ~(int)(sprite[spritenum].lotag<=0);
lt &= ~(int)((sprite[spritenum].hitag<=0)<<1);
if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
{
@ -1754,7 +1754,7 @@ void ExtShowWallData(int16_t wallnum) //F6
if (runi==1 && sprite[i].picnum!=RESPAWN)
continue;
pic = (runi==0) ? sprite[i].picnum : sprite[i].hitag;
pic = (runi==0) ? (int)sprite[i].picnum : (int)sprite[i].hitag;
if (pic<0 || pic>=MAXTILES)
continue;
@ -4269,8 +4269,8 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
if (small)
x1 /= 2;
x1 *= 320.0/xdimgame;
scale /= (max(tilesizx[picnum],tilesizy[picnum])/24.0);
x1 = (int32_t)(x1 * 320.0/xdimgame);
scale = (int32_t)(max(tilesizx[picnum],tilesizy[picnum])/24.0);
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
// +1024: prevents rotatesprite from setting aspect itself
@ -4278,8 +4278,8 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
setaspect(oviewingrange, oyxaspect);
}
x *= xdimgame/320.0;
y *= ydimgame/200.0;
x = (int32_t)(x * xdimgame/320.0);
y = (int32_t)(y * ydimgame/200.0);
begindrawing();
printext256(x+2,y+2,0,-1,title,small);
@ -5001,8 +5001,8 @@ static void Keys3d(void)
}
}
x = WIND1X*(xdimgame/320.);
y = WIND1Y*(ydimgame/200.);
x = (int32_t)(WIND1X*(xdimgame/320.));
y = (int32_t)(WIND1Y*(ydimgame/200.));
y += (ydimgame>>6)*8;
if (getmessageleng)
@ -5545,9 +5545,9 @@ static void Keys3d(void)
if (eitherCTRL) //CTRL
{
if (tsign==1)
visibility <<= (visibility < 16384);
visibility <<= (int)(visibility < 16384);
else
visibility >>= (visibility > 32);
visibility >>= (int)(visibility > 32);
silentmessage("Global visibility %d", visibility);
}
else
@ -10762,7 +10762,7 @@ void ExtPreCheckKeys(void) // just before drawrooms
}
if (check_prlight_colors(i))
copy_prlight_colors(spritelightptr[i], i);
if (!!(CS & 128) != spritelightptr[i]->publicflags.negative)
if ((int)!!(CS & 128) != spritelightptr[i]->publicflags.negative)
{
spritelightptr[i]->publicflags.negative = !!(CS & 128);
}
@ -10816,11 +10816,11 @@ void ExtPreCheckKeys(void) // just before drawrooms
spritelightptr[i]->horiz = SH;
spritelightptr[i]->flags.invalidate = 1;
}
if (!(CS & 64) != spritelightptr[i]->publicflags.emitshadow)
if ((int)!(CS & 64) != spritelightptr[i]->publicflags.emitshadow)
{
spritelightptr[i]->publicflags.emitshadow = !(CS & 64);
}
if (!!(CS & 128) != spritelightptr[i]->publicflags.negative)
if ((int)!!(CS & 128) != spritelightptr[i]->publicflags.negative)
{
spritelightptr[i]->publicflags.negative = !!(CS & 128);
}

View File

@ -728,7 +728,7 @@ nextdemo_nomenu:
if (Demo_IsProfiling())
{
int32_t t = gethitickms();
int32_t t = (int32_t)gethitickms();
G_DoMoveThings();
Demo_GToc(t);
}

View File

@ -3585,8 +3585,8 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
// If the view is rotated (not 0 or 180 degrees modulo 360 degrees),
// we render onto a square tile and display a portion of that
// rotated on-screen later on.
const int32_t viewtilexsiz = ((tang&1023) ? tiltcx : tiltcy)>>!ud.detail;
const int32_t viewtileysiz = tiltcx>>!ud.detail;
const int32_t viewtilexsiz = ((tang&1023) ? tiltcx : tiltcy)>>(int)!ud.detail;
const int32_t viewtileysiz = tiltcx>>(int)!ud.detail;
walock[TILE_TILT] = 255;
if (waloff[TILE_TILT] == 0)
@ -3598,8 +3598,8 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio)
if ((tang&1023) == 512)
{
//Block off unscreen section of 90ø tilted screen
j = ((tiltcx-(60*tiltcs))>>!ud.detail);
for (i=((60*tiltcs)>>!ud.detail)-1; i>=0; i--)
j = ((tiltcx-(60*tiltcs))>>(int)!ud.detail);
for (i=((60*tiltcs)>>(int)!ud.detail)-1; i>=0; i--)
{
startumost[i] = 1;
startumost[i+j] = 1;
@ -7674,7 +7674,7 @@ void G_HandleLocalKeys(void)
if (KB_KeyPressed(sc_kpad_6))
{
KB_ClearKeyDown(sc_kpad_6);
j = (15<<ALT_IS_PRESSED)<<(2*SHIFTS_IS_PRESSED);
j = (15<<(int)ALT_IS_PRESSED)<<(2*(int)SHIFTS_IS_PRESSED);
g_demo_goalCnt = g_demo_paused ? g_demo_cnt+1 : g_demo_cnt+REALGAMETICSPERSEC*j;
g_demo_rewind = 0;
@ -7686,7 +7686,7 @@ void G_HandleLocalKeys(void)
else if (KB_KeyPressed(sc_kpad_4))
{
KB_ClearKeyDown(sc_kpad_4);
j = (15<<ALT_IS_PRESSED)<<(2*SHIFTS_IS_PRESSED);
j = (15<<(int)ALT_IS_PRESSED)<<(2*(int)SHIFTS_IS_PRESSED);
g_demo_goalCnt = g_demo_paused ? g_demo_cnt-1 : g_demo_cnt-REALGAMETICSPERSEC*j;
g_demo_rewind = 1;

View File

@ -5812,8 +5812,9 @@ static void C_InitProjectiles(void)
defaultprojectile_t DefaultProjectile =
{
1, -1, 2048, 0, 0, SMALLSMOKE, -1, -1, 600, BULLETHOLE, -1, 0, 0, 448, g_numFreezeBounces, PIPEBOMB_BOUNCE, 1,
100, -1, -1, -1, -1, -1, -96, 18, 18, 0, 1, 32, {0,0,0,0,0,0},
1, -1, 2048, 0, 0, (int16_t)SMALLSMOKE, -1, -1, 600, (int16_t)BULLETHOLE, -1, 0, 0, 448,
(int16_t)g_numFreezeBounces, (int16_t)PIPEBOMB_BOUNCE, 1, 100, -1, -1, -1, -1, -1, -96, 18, 18,
0, 1, 32, {0,0,0,0,0,0},
};
// this will only happen if I forget to update this function...

View File

@ -33,15 +33,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct grpfile grpfiles[NUMGRPFILES] =
{
{ "Duke Nukem 3D", 0xBBC9CE44, 26524524, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D (South Korean Censored)", 0xAA4F6A40, 26385383, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D: Atomic Edition", 0xFD3DCFF1, 44356548, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D: Atomic Edition (Censored)", 0xF514A6AC, 44348015, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D Shareware", 0x983AD923, 11035779, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D Mac Shareware", 0xC5F71561, 10444391, GAMEFLAG_DUKE, NULL },
{ "NAM", 0x75C1F07B, 43448927, GAMEFLAG_NAM, NULL },
{ "Napalm", 0x3DE1589A, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, NULL },
{ "WWII GI", 0x907B82BF, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, NULL },
{ "Duke Nukem 3D", (int32_t)0xBBC9CE44, 26524524, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D (South Korean Censored)", (int32_t)0xAA4F6A40, 26385383, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D: Atomic Edition", (int32_t)0xFD3DCFF1, 44356548, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D: Plutonium Pak", (int32_t)0xF514A6AC, 44348015, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D Shareware", (int32_t)0x983AD923, 11035779, GAMEFLAG_DUKE, NULL },
{ "Duke Nukem 3D Mac Shareware", (int32_t)0xC5F71561, 10444391, GAMEFLAG_DUKE, NULL },
{ "NAM", (int32_t)0x75C1F07B, 43448927, GAMEFLAG_NAM, NULL },
{ "Napalm", (int32_t)0x3DE1589A, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, NULL },
{ "WWII GI", (int32_t)0x907B82BF, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, NULL },
};
struct grpfile *foundgrps = NULL;