diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index a5a43eea9..d561d5459 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -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; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 6bd1820b3..890631659 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -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]; diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index 375cf9488..16f2964e4 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -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) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index dd7c30ea3..3d0c6da29 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -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) diff --git a/polymer/eduke32/build/src/pragmas.c b/polymer/eduke32/build/src/pragmas.c index 9aeefa591..70944cd03 100644 --- a/polymer/eduke32/build/src/pragmas.c +++ b/polymer/eduke32/build/src/pragmas.c @@ -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) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 86183012c..8d179e0a5 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -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; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 3963b0f96..4130f0250 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -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); } diff --git a/polymer/eduke32/source/demo.c b/polymer/eduke32/source/demo.c index c04aa3da0..a4df4746e 100644 --- a/polymer/eduke32/source/demo.c +++ b/polymer/eduke32/source/demo.c @@ -728,7 +728,7 @@ nextdemo_nomenu: if (Demo_IsProfiling()) { - int32_t t = gethitickms(); + int32_t t = (int32_t)gethitickms(); G_DoMoveThings(); Demo_GToc(t); } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 9e737ffaf..4ba61eb4e 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -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<