- revert to warning level 3.

Some stock warnings are far too noisy when level 4 is on.
This commit is contained in:
Christoph Oelckers 2022-10-12 00:01:55 +02:00
parent 5f50ee5204
commit 9c097e1763
2 changed files with 5 additions and 4 deletions

View file

@ -25,7 +25,8 @@ endif()
# Build does not work with signed chars! Also set a stricter warning level, but silence the pointless and annoying parts of level 4 (Intentionally only for C++! The C code we use is too old and would warn too much)
if (MSVC)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J /W4 /wd4100 /wd4127 /wd4131 /wd4201 /wd4210 /wd4244 /wd4245 /wd4324 /wd4389 /wd4505 /wd4706 /wd4458 /wd4459" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /J /W3 /wd4100 /wd4127 /wd4131 /wd4201 /wd4210 /wd4245 /wd4324 /wd4389 /wd4505 /wd4706 /wd4458 /wd4459" )
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4189" ) # "unused initialized local variable" - useful warning that creates too much noise in external or macro based code. Can be enabled for cleanup passes on the code.
else()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -funsigned-char -Wno-missing-braces -Wno-char-subscripts -Wno-unused-variable" )

View file

@ -4162,7 +4162,7 @@ static void checkCeilHit(DBloodActor* actor)
}
if (mass1 > mass2)
{
int dmg = 4 * (abs((mass1 - mass2) * actor2->clipdist) - actor->clipdist);
int dmg = int(4 * (abs((mass1 - mass2) * actor2->clipdist) - actor->clipdist));
if (actor2->IsDudeActor())
{
if (dmg > 0) actDamageSprite(actor2, actor, (Chance(0x2000)) ? kDamageFall : (Chance(0x4000)) ? kDamageExplode : kDamageBullet, dmg);
@ -4326,7 +4326,7 @@ static void checkFloorHit(DBloodActor* actor)
if ((actor2->IsPlayerActor() && Chance(0x500)) || !actor2->IsPlayerActor())
actKickObject(actor, actor2);
int dmg = (mass1 - mass2) + actor->clipdist * 4;
int dmg = int((mass1 - mass2) + actor->clipdist * 4);
if (dmg > 0) actDamageSprite(actor, actor2, (Chance(0x2000)) ? kDamageFall : kDamageBullet, dmg);
}
}
@ -4959,7 +4959,7 @@ void MoveDude(DBloodActor* actor)
pPlayer->posture = 1;
actor->xspr.burnTime = 0;
pPlayer->bubbleTime = abs(actor->vel.Z * 16);
pPlayer->bubbleTime = int(abs(actor->vel.Z * 16));
evPostActor(actor, 0, kCallbackPlayerBubble);
sfxPlay3DSound(actor, 720, -1, 0);
}