SW: Fix warning: comparison is always false due to limited range of data type [-Wtype-limits]

git-svn-id: https://svn.eduke32.com/eduke32@5219 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-19 22:07:54 +00:00
parent 34aca8a222
commit d1582b8d0f
3 changed files with 6 additions and 6 deletions

View File

@ -652,7 +652,7 @@ int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, short ang, short
else
{
wallp->picnum = break_info->breaknum;
if (wallp->hitag < 0)
if ((int16_t)wallp->hitag < 0)
DoWallBreakSpriteMatch(wallp->hitag);
}
}
@ -963,7 +963,7 @@ int AutoBreakSprite(short BreakSprite, short type)
break_info = FindSpriteBreakInfo(bp->picnum);
if (bp->hitag < 0)
if ((int16_t)bp->hitag < 0)
DoWallBreakMatch(bp->hitag);
if (!break_info)

View File

@ -2291,7 +2291,7 @@ ExtGetSpriteCaption(short spritenum)
// Non ST1 sprites that are tagged like them
if (TEST_BOOL1(sp) && sp->picnum != ST1)
{
if (SP_TAG1(sp) < 0 || SP_TAG1(sp) > 1006)
if ((uint16_t)SP_TAG1(sp) > 1006)
sprintf(name, "Invalid Tag");
else
sprintf(name, "%s,", StagInfo[SP_TAG1(sp)].name); // This page faults if
@ -2303,7 +2303,7 @@ ExtGetSpriteCaption(short spritenum)
switch (sp->picnum)
{
case ST1:
if (SP_TAG1(sp) < 0 || SP_TAG1(sp) > 1006)
if ((uint16_t)SP_TAG1(sp) > 1006)
sprintf(name, "Invalid Tag");
else
sprintf(name, "*%s,", StagInfo[SP_TAG1(sp)].name);

View File

@ -87,7 +87,7 @@ void DoQuakeMatch(short match)
if (QUAKE_Match(sp) == match)
{
if (QUAKE_WaitTics(sp) > 0)
if ((int16_t)QUAKE_WaitTics(sp) > 0)
{
// its not waiting any more
RESET_BOOL3(sp);
@ -147,7 +147,7 @@ void ProcessQuakeSpot(void)
// spawn a quake if time is up
//QUAKE_WaitTics(sp) -= 4*synctics;
SET_SP_TAG13(sp, (QUAKE_WaitTics(sp)-4*synctics));
if (QUAKE_WaitTics(sp) < 0)
if ((int16_t)QUAKE_WaitTics(sp) < 0)
{
// reset timer - add in Duration of quake
//QUAKE_WaitTics(sp) = ((QUAKE_WaitSecs(sp)*10L) + QUAKE_Duration(sp)) * 120L;