From a4a9dade68cfaf4e7d420ccb97d3acba43d39943 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 26 Sep 2014 13:11:32 -0400 Subject: [PATCH] boot: Fix some always false conditions --- src/system/boot/platform/atari_m68k/console.cpp | 2 +- src/system/boot/platform/atari_m68k/cpu.cpp | 6 +++--- src/system/boot/platform/cfe/console.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/system/boot/platform/atari_m68k/console.cpp b/src/system/boot/platform/atari_m68k/console.cpp index f65c297a99..6fb806d82a 100644 --- a/src/system/boot/platform/atari_m68k/console.cpp +++ b/src/system/boot/platform/atari_m68k/console.cpp @@ -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; diff --git a/src/system/boot/platform/atari_m68k/cpu.cpp b/src/system/boot/platform/atari_m68k/cpu.cpp index e71c1a76a7..77fb691262 100644 --- a/src/system/boot/platform/atari_m68k/cpu.cpp +++ b/src/system/boot/platform/atari_m68k/cpu.cpp @@ -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"); diff --git a/src/system/boot/platform/cfe/console.cpp b/src/system/boot/platform/cfe/console.cpp index d11012bfc1..28902d0245 100644 --- a/src/system/boot/platform/cfe/console.cpp +++ b/src/system/boot/platform/cfe/console.cpp @@ -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];