- silenced some warnings.

This commit is contained in:
Christoph Oelckers 2021-05-12 00:48:41 +02:00
parent 3f42ee9a86
commit 03289f5097
8 changed files with 20 additions and 29 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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 };

View file

@ -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;

View file

@ -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);

View file

@ -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;