Fix more warnings.

This commit is contained in:
BearOso 2022-04-28 18:58:55 -05:00
parent 375a263961
commit d99f79bcc0
2 changed files with 28 additions and 55 deletions

View File

@ -328,14 +328,12 @@ static void DoGunLatch (int x, int y)
if (x > 295)
x = 295;
else
if (x < 40)
else if (x < 40)
x = 40;
if (y > PPU.ScreenHeight - 1)
y = PPU.ScreenHeight - 1;
else
if (y < 0)
else if (y < 0)
y = 0;
PPU.GunVLatch = (uint16) (y + 1);
@ -1164,8 +1162,7 @@ s9xcommand_t S9xGetCommandT (const char *name)
if (!strcmp(name, "None"))
cmd.type = S9xNoMapping;
else
if (!strncmp(name, "Joypad", 6))
else if (!strncmp(name, "Joypad", 6))
{
if (name[6] < '1' || name[6] > '8' || name[7] != ' ')
return (cmd);
@ -1176,24 +1173,15 @@ s9xcommand_t S9xGetCommandT (const char *name)
s = name + 13;
if (!strncmp(s, "Left/Right ", 11)) { j = 0; i = 0; s += 11; }
else
if (!strncmp(s, "Right/Left ", 11)) { j = 0; i = 1; s += 11; }
else
if (!strncmp(s, "Up/Down ", 8)) { j = 1; i = 0; s += 8; }
else
if (!strncmp(s, "Down/Up ", 8)) { j = 1; i = 1; s += 8; }
else
if (!strncmp(s, "Y/A ", 4)) { j = 2; i = 0; s += 4; }
else
if (!strncmp(s, "A/Y ", 4)) { j = 2; i = 1; s += 4; }
else
if (!strncmp(s, "X/B ", 4)) { j = 3; i = 0; s += 4; }
else
if (!strncmp(s, "B/X ", 4)) { j = 3; i = 1; s += 4; }
else
if (!strncmp(s, "L/R ", 4)) { j = 4; i = 0; s += 4; }
else
if (!strncmp(s, "R/L ", 4)) { j = 4; i = 1; s += 4; }
else if (!strncmp(s, "Right/Left ", 11)) { j = 0; i = 1; s += 11; }
else if (!strncmp(s, "Up/Down ", 8)) { j = 1; i = 0; s += 8; }
else if (!strncmp(s, "Down/Up ", 8)) { j = 1; i = 1; s += 8; }
else if (!strncmp(s, "Y/A ", 4)) { j = 2; i = 0; s += 4; }
else if (!strncmp(s, "A/Y ", 4)) { j = 2; i = 1; s += 4; }
else if (!strncmp(s, "X/B ", 4)) { j = 3; i = 0; s += 4; }
else if (!strncmp(s, "B/X ", 4)) { j = 3; i = 1; s += 4; }
else if (!strncmp(s, "L/R ", 4)) { j = 4; i = 0; s += 4; }
else if (!strncmp(s, "R/L ", 4)) { j = 4; i = 1; s += 4; }
else
return (cmd);
@ -1374,8 +1362,7 @@ s9xcommand_t S9xGetCommandT (const char *name)
if (*s == 'h')
cmd.axis.pointer.HV = 0;
else
if (*s == 'v')
else if (*s == 'v')
cmd.axis.pointer.HV = 1;
else
return (cmd);
@ -1523,8 +1510,7 @@ s9xcommand_t S9xGetCommandT (const char *name)
j = i;
}
else
if (name[i] == ',')
else if (name[i] == ',')
{
free(c);
return (cmd);
@ -1537,8 +1523,7 @@ s9xcommand_t S9xGetCommandT (const char *name)
{
if (name[i] == '+')
press = 1;
else
if (name[i] == '-')
else if (name[i] == '-')
press = 2;
else
{
@ -2007,14 +1992,12 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2)
uint16 x = r; r = st; st = x;
x = s; s = t; t = x;
}
else
if (cmd.button.joypad.turbo)
else if (cmd.button.joypad.turbo)
{
uint16 x = r; r = t; t = x;
x = s; s = st; st = x;
}
else
if (cmd.button.joypad.sticky)
else if (cmd.button.joypad.sticky)
{
uint16 x = r; r = s; s = x;
x = t; t = st; st = x;
@ -2767,14 +2750,12 @@ static void UpdatePolledMouse (int i)
mouse[i - MOUSE0].delta_x = 0xff;
mouse[i - MOUSE0].old_x -= 127;
}
else
if (j < 0)
else if (j < 0)
{
mouse[i - MOUSE0].delta_x = 0x80 | -j;
mouse[i - MOUSE0].old_x = mouse[i - MOUSE0].cur_x;
}
else
if (j > 127)
else if (j > 127)
{
mouse[i - MOUSE0].delta_x = 0x7f;
mouse[i - MOUSE0].old_x += 127;
@ -2792,14 +2773,12 @@ static void UpdatePolledMouse (int i)
mouse[i - MOUSE0].delta_y = 0xff;
mouse[i - MOUSE0].old_y -= 127;
}
else
if (j < 0)
else if (j < 0)
{
mouse[i - MOUSE0].delta_y = 0x80 | -j;
mouse[i - MOUSE0].old_y = mouse[i - MOUSE0].cur_y;
}
else
if (j > 127)
else if (j > 127)
{
mouse[i - MOUSE0].delta_y = 0x7f;
mouse[i - MOUSE0].old_y += 127;
@ -3261,8 +3240,7 @@ void S9xControlEOF (void)
pseudopointer[n].x += pseudopointer[n].H_adj;
if (pseudopointer[n].x < 0)
pseudopointer[n].x = 0;
else
if (pseudopointer[n].x > 255)
else if (pseudopointer[n].x > 255)
pseudopointer[n].x = 255;
if (pseudopointer[n].H_var)
@ -3285,8 +3263,7 @@ void S9xControlEOF (void)
pseudopointer[n].y += pseudopointer[n].V_adj;
if (pseudopointer[n].y < 0)
pseudopointer[n].y = 0;
else
if (pseudopointer[n].y > PPU.ScreenHeight - 1)
else if (pseudopointer[n].y > PPU.ScreenHeight - 1)
pseudopointer[n].y = PPU.ScreenHeight - 1;
if (pseudopointer[n].V_var)

14
gfx.cpp
View File

@ -623,8 +623,7 @@ static void SetupOBJ (void)
{
if (HPos < 0)
GFX.OBJVisibleTiles[S] = (GFX.OBJWidths[S] + HPos + 7) >> 3;
else
if (HPos + GFX.OBJWidths[S] > 255)
else if (HPos + GFX.OBJWidths[S] > 255)
GFX.OBJVisibleTiles[S] = (256 - HPos + 7) >> 3;
else
GFX.OBJVisibleTiles[S] = GFX.OBJWidths[S] >> 3;
@ -695,8 +694,7 @@ static void SetupOBJ (void)
{
if (HPos < 0)
GFX.OBJVisibleTiles[S] = (GFX.OBJWidths[S] + HPos + 7) >> 3;
else
if (HPos + GFX.OBJWidths[S] >= 257)
else if (HPos + GFX.OBJWidths[S] >= 257)
GFX.OBJVisibleTiles[S] = (257 - HPos + 7) >> 3;
else
GFX.OBJVisibleTiles[S] = GFX.OBJWidths[S] >> 3;
@ -2000,7 +1998,7 @@ static void DisplayWatchedAddresses (void)
break;
int32 displayNumber = 0;
char buf[32];
char buf[64];
for (int r = 0; r < watches[i].size; r++)
displayNumber += (Cheat.CWatchRAM[(watches[i].address - 0x7E0000) + r]) << (8 * r);
@ -2014,11 +2012,9 @@ static void DisplayWatchedAddresses (void)
{
if (watches[i].size == 1)
displayNumber = (int32) ((int8) displayNumber);
else
if (watches[i].size == 2)
else if (watches[i].size == 2)
displayNumber = (int32) ((int16) displayNumber);
else
if (watches[i].size == 3)
else if (watches[i].size == 3)
if (displayNumber >= 8388608)
displayNumber -= 16777216;