Fix some gcc related issues

This commit is contained in:
nukeykt 2019-11-14 07:13:11 +09:00 committed by Christoph Oelckers
parent cab17d9ff7
commit 53c6e40d6d
4 changed files with 13 additions and 4 deletions

View file

@ -3424,7 +3424,7 @@ int Query(short nLines, short nKeys, ...)
}
for (i = 0; i < nKeys; i++) {
keys[i] = va_arg(args, char);
keys[i] = (char)va_arg(args, int);
}
va_end(args);

View file

@ -833,10 +833,9 @@ loc_flag:
short thetargetthin = sPlayerInput[nPlayer].nTarget;
assert(sprite[sPlayerInput[nPlayer].nTarget].sectnum < kMaxSectors);
if (sPlayerInput[nPlayer].nTarget >= 0)
{
assert(sprite[sPlayerInput[nPlayer].nTarget].sectnum < kMaxSectors);
var_50 = sPlayerInput[nPlayer].nTarget + 10000;
}

View file

@ -799,7 +799,7 @@ int BuildWallFace(short nChannel, short nWall, short nCount, ...)
int i = WallFace[WallFaceCount].field_4;
WallFace[WallFaceCount].field_4++;
WallFace[WallFaceCount].field_6[i] = va_arg(piclist, short);
WallFace[WallFaceCount].field_6[i] = (short)va_arg(piclist, int);
}
va_end(piclist);

View file

@ -1011,7 +1011,17 @@ void PlayAlert(const char *str)
void DoKenTest()
{
int nPlayerSprite = PlayerList[0].nSprite; // CHECKME
if ((unsigned int)nPlayerSprite >= kMaxSprites)
{
initprintf("DoKenTest: (unsigned int)nPlayerSprite >= kMaxSprites)\n");
return;
}
int nSector = sprite[nPlayerSprite].sectnum;
if ((unsigned int)nSector >= kMaxSectors)
{
initprintf("DoKenTest: (unsigned int)nSector >= kMaxSectors\n");
return;
}
for (int i = headspritesect[nSector]; ; i = nextspritesect[i])
{