- Removed what appears to be a debug breakpoint.

- Cleared some GCC and Clang warnings. Mostly static analysis false positives, but one of them generated a pretty massive warning in a release build.
- Use -Wno-unused-result since I doubt we're going to address those unless they actually prove to be a problem (and they only appear in release builds).
This commit is contained in:
Braden Obrzut 2016-01-23 19:33:26 -05:00
parent 0dabaca7df
commit 88a616da75
9 changed files with 53 additions and 49 deletions

View File

@ -8,7 +8,7 @@ include( CheckCXXCompilerFlag )
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DDEBUGMODE=1" )
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-pointer-sign -Wno-uninitialized" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-pointer-sign -Wno-uninitialized -Wno-unused-but-set-variable" )
endif( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
CHECK_FUNCTION_EXISTS( itoa ITOA_EXISTS )

View File

@ -456,7 +456,8 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set( CMAKE_CXX_FLAGS_MINSIZEREL "${REL_CXX_FLAGS} ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${REL_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers ${CMAKE_CXX_FLAGS}" )
set( CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result ${CMAKE_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result ${CMAKE_CXX_FLAGS}" )
# Remove extra warnings when using the official DirectX headers.
# Also, TDM-GCC 4.4.0 no longer accepts glibc-style printf formats as valid,

View File

@ -5939,7 +5939,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
const PClass *type, angle_t angle, AActor **pLineTarget, AActor **pMissileActor,
bool nofreeaim, bool noautoaim)
{
static const int angdiff[3] = { -1<<26, 1<<26, 0 };
static const int angdiff[3] = { -(1<<26), 1<<26, 0 };
angle_t an = angle;
angle_t pitch;
AActor *linetarget;

View File

@ -891,7 +891,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash)
angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget)
{
static const int angdiff[3] = { -1<<26, 1<<26, 0 };
static const int angdiff[3] = { -(1<<26), 1<<26, 0 };
int i;
angle_t an;
angle_t pitch;

View File

@ -1223,7 +1223,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
if (!nothinkers)
{
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
new DScroller(DScroller::sc_floor, (-FRACUNIT / 2) << 3,
new DScroller(DScroller::sc_floor, -((FRACUNIT / 2) << 3),
0, -1, int(sector - sectors), 0);
}
keepspecial = true;

View File

@ -108,7 +108,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
sector_t *destsect;
bool resetpitch = false;
fixed_t floorheight, ceilingheight;
fixed_t missilespeed;
fixed_t missilespeed = 0;
old = thing->Pos();
aboveFloor = thing->Z() - thing->floorz;

View File

@ -447,8 +447,6 @@ void DSectorPlaneInterpolation::UpdateInterpolation()
oldheight = sector->ceilingplane.d;
oldtexz = sector->GetPlaneTexZ(sector_t::ceiling);
}
if (oldtexz <-128*FRACUNIT)
__asm nop
}
//==========================================================================

View File

@ -676,6 +676,16 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
z = y = x = 0;
}
// [BL] Moved this case out of the switch statement to make code easier
// on static analysis.
if(type == SOURCE_Unattached)
{
pos->X = pt[0];
pos->Y = !(chanflags & CHAN_LISTENERZ) ? pt[1] : FIXED2FLOAT(y);
pos->Z = pt[2];
}
else
{
switch (type)
{
case SOURCE_None:
@ -713,15 +723,8 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
assert(poly != NULL);
CalcPolyobjSoundOrg(poly, &x, &z, &y);
break;
case SOURCE_Unattached:
pos->X = pt[0];
pos->Y = !(chanflags & CHAN_LISTENERZ) ? pt[1] : FIXED2FLOAT(y);
pos->Z = pt[2];
break;
}
if (type != SOURCE_Unattached)
{
if ((chanflags & CHAN_LISTENERZ) && players[consoleplayer].camera != NULL)
{
y = players[consoleplayer].camera != NULL ? players[consoleplayer].camera->SoundZ() : 0;

View File

@ -1059,7 +1059,9 @@ void FSingleLumpFont::LoadTranslations()
break;
default:
break;
// Should be unreachable.
I_Error("Unknown font type in FSingleLumpFont::LoadTranslation.");
return;
}
for(unsigned int i = 0;i < count;++i)