Skip to content

Commit

Permalink
boot: Fix some always false conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lioncash authored and mmuman committed Sep 26, 2014
1 parent 907046d commit a4a9dad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/system/boot/platform/atari_m68k/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ translate_color(int32 color)
15, 4, 2, 6, 1, 5, 3, 7,
8, 12, 10, 14, 9, 13, 11, 0 };

if (color < 0 && color >= 16)
if (color < 0 || color >= 16)
return 0;
return cmap[color];
//return color;
Expand Down
6 changes: 3 additions & 3 deletions src/system/boot/platform/atari_m68k/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ check_cpu_features()
fpu = 68060;
else if (fpu_type & 0x8)
fpu = 68040;
else if (fpu_type & 0x6 == 0x6)
else if ((fpu_type & 0x6) == 0x6)
fpu = 68882;
else if (fpu_type & 0x6 == 0x4)
else if ((fpu_type & 0x6) == 0x4)
fpu = 68881;
else if (fpu_type & 0x6 == 0x2)
else if ((fpu_type & 0x6) == 0x2)
fpu = 68881; // not certain
else if (fpu_type & 0x4) {
panic("bad fpu");
Expand Down
4 changes: 2 additions & 2 deletions src/system/boot/platform/cfe/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ VTConsole::SetColor(int32 foreground, int32 background)
8, 12, 10, 14, 9, 13, 11, 0 };
char buff[] = "\033b \033c ";

if (foreground < 0 && foreground >= 16)
if (foreground < 0 || foreground >= 16)
return;
if (background < 0 && background >= 16)
if (background < 0 || background >= 16)
return;

buff[2] += cmap[foreground];
Expand Down

0 comments on commit a4a9dad

Please sign in to comment.