From 03289f50976e4466a5e3d46920721d6a74be800b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 May 2021 00:48:41 +0200 Subject: [PATCH] - silenced some warnings. --- CMakeLists.txt | 2 +- source/core/rendering/scene/hw_drawstructs.h | 4 ---- source/games/blood/src/actor.cpp | 2 +- source/games/duke/src/actors.cpp | 21 ++++++++------------ source/games/exhumed/src/2d.cpp | 8 ++++---- source/games/sw/src/actor.cpp | 4 ++-- source/games/sw/src/game.h | 4 ++-- source/games/sw/src/sprite.cpp | 4 ++-- 8 files changed, 20 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa7d66978..a5696bb77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,7 @@ if( MSVC ) set( ALL_C_FLAGS "${ALL_C_FLAGS} /wd4996 /DUNICODE /D_UNICODE /D_WIN32_WINNT=0x0600" ) # These must be silenced because the code is full of them. Expect some of undefined behavior hidden in this mess. :( - set( ALL_C_FLAGS "${ALL_C_FLAGS} /wd4244 /wd4018 /wd4267" ) + #set( ALL_C_FLAGS "${ALL_C_FLAGS} /wd4244 /wd4018 /wd4267" ) # Most of these need to be cleaned out. The source is currently infested with far too much conditional compilation which is a constant source of problems. diff --git a/source/core/rendering/scene/hw_drawstructs.h b/source/core/rendering/scene/hw_drawstructs.h index f5658b8f3..e888a8794 100644 --- a/source/core/rendering/scene/hw_drawstructs.h +++ b/source/core/rendering/scene/hw_drawstructs.h @@ -15,10 +15,6 @@ #include "hw_renderstate.h" #include "hw_cvars.h" -#ifdef _MSC_VER -#pragma warning(disable:4244) -#endif - struct HWHorizonInfo; struct HWSkyInfo; class FMaterial; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 60bbf823b..63f2db9db 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2926,7 +2926,7 @@ bool actHealDude(DBloodActor* actor, int add, int threshold) auto pXDude = &actor->x(); add <<= 4; threshold <<= 4; - if (pXDude->health < threshold) + if (pXDude->health < (unsigned)threshold) { spritetype* pSprite = &actor->s(); if (actor->IsPlayerActor()) sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 780, pSprite->sectnum); diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 89ba3c3fa..3ad7d14dd 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -316,19 +316,14 @@ void ms(DDukeActor* const actor) void movecyclers(void) { - short q, j, x, t, s, * c; - walltype* wal; - char cshade; - - for (q = numcyclers - 1; q >= 0; q--) + for (int q = numcyclers - 1; q >= 0; q--) { + short* c = &cyclers[q][0]; + int s = c[0]; - c = &cyclers[q][0]; - s = c[0]; - - t = c[3]; - j = t + bsin(c[1], -10); - cshade = c[2]; + int t = c[3]; + int j = t + bsin(c[1], -10); + int cshade = c[2]; if (j < cshade) j = cshade; else if (j > t) j = t; @@ -336,8 +331,8 @@ void movecyclers(void) c[1] += sector[s].extra; if (c[5]) { - wal = &wall[sector[s].wallptr]; - for (x = sector[s].wallnum; x > 0; x--, wal++) + auto wal = &wall[sector[s].wallptr]; + for (int x = sector[s].wallnum; x > 0; x--, wal++) if (wal->hitag != 1) { wal->shade = j; diff --git a/source/games/exhumed/src/2d.cpp b/source/games/exhumed/src/2d.cpp index c6035b582..faf16a4a6 100644 --- a/source/games/exhumed/src/2d.cpp +++ b/source/games/exhumed/src/2d.cpp @@ -137,10 +137,10 @@ void DrawRel(int tile, double x, double y, int shade) // this might be static within the DoPlasma function? static uint8_t* PlasmaBuffer; static int nPlasmaTile = kTile4092; -static unsigned int nSmokeBottom; -static unsigned int nSmokeRight; -static unsigned int nSmokeTop; -static unsigned int nSmokeLeft; +static int nSmokeBottom; +static int nSmokeRight; +static int nSmokeTop; +static int nSmokeLeft; static int nextPlasmaTic; static int plasma_A[5] = { 0 }; static int plasma_B[5] = { 0 }; diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 79f8601e5..8307b4398 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -309,7 +309,7 @@ DoDebrisCurrent(SPRITEp sp) // faster than move_sprite //move_missile(sp-sprite, nx, ny, 0, Z(2), Z(0), 0, ACTORMOVETICS); - ret = move_sprite(sp-sprite, nx, ny, 0, u->ceiling_dist, u->floor_dist, 0, ACTORMOVETICS); + ret = move_sprite(int(sp-sprite), nx, ny, 0, u->ceiling_dist, u->floor_dist, 0, ACTORMOVETICS); // attempt to move away from wall if (ret) @@ -319,7 +319,7 @@ DoDebrisCurrent(SPRITEp sp) nx = MulScale(DIV4(sectu->speed), bcos(sectu->ang + rang), 14); nx = MulScale(DIV4(sectu->speed), bsin(sectu->ang + rang), 14); - move_sprite(sp-sprite, nx, ny, 0, u->ceiling_dist, u->floor_dist, 0, ACTORMOVETICS); + move_sprite(int(sp-sprite), nx, ny, 0, u->ceiling_dist, u->floor_dist, 0, ACTORMOVETICS); } sp->z = u->loz; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index f2c7d24ad..774d50dcf 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1984,8 +1984,8 @@ short AnimSetVelAdj(short anim_ndx, short vel_adj); void EnemyDefaults(short SpriteNum, ACTOR_ACTION_SETp action, PERSONALITYp person); void getzrangepoint(int x, int y, int z, short sectnum, int32_t* ceilz, int32_t* ceilhit, int32_t* florz, int32_t* florhit); -int move_sprite(short spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics); -int move_missile(short spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics); +int move_sprite(int spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics); +int move_missile(int spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics); int DoPickTarget(SPRITEp sp, uint32_t max_delta_ang, int skip_targets); void change_sprite_stat(short, short); diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 6646bae45..a21544861 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -6935,7 +6935,7 @@ SpriteControl(void) */ int -move_sprite(short spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics) +move_sprite(int spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics) { int daz; int retval=0, zh; @@ -7183,7 +7183,7 @@ MissileZrange(short SpriteNum) int -move_missile(short spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics) +move_missile(int spritenum, int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics) { int daz; int retval, zh;