From c908c329a97bca6924ed9db0137be6f17d9fe179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Fri, 4 Apr 2014 16:24:13 +0000 Subject: [PATCH] fixed firewave: "And here's a few MESS/core ones I overlooked yesterday: s:\svn\mame\src\emu\cpu\dsp16\dsp16ops.inc(365) : warning C6316: Incorrect operator: tested expression is constant and non-zero. Use bitwise-and to determine whether bits are set. s:\svn\mame\src\emu\cpu\es5510\es5510.c(608) : warning C6201: Index '255' is out of valid index range '0' to '254' for possibly stack allocated buffer 'is_written'. s:\svn\mame\src\emu\cpu\es5510\es5510.c(608) : warning C6201: Index '255' is out of valid index range '0' to '254' for possibly stack allocated buffer 'is_read'. s:\svn\mame\src\emu\cpu\es5510\es5510.c(609) : warning C6201: Index '255' is out of valid index range '0' to '254' for possibly stack allocated buffer 'name'. s:\svn\mame\src\emu\cpu\es5510\es5510.c(666) : warning C6201: Index '255' is out of valid index range '0' to '254' for possibly stack allocated buffer 'name'. s:\svn\mame\src\emu\cpu\m68000\m68kcpu.c(681) : warning C6314: Incorrect order of operations: bitwise-or has higher precedence than the conditional-expression operator. Add parentheses to clarify intent. " --- src/emu/cpu/dsp16/dsp16ops.inc | 4 ++-- src/emu/cpu/es5510/es5510.c | 4 ++-- src/emu/cpu/m68000/m68kcpu.c | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/emu/cpu/dsp16/dsp16ops.inc b/src/emu/cpu/dsp16/dsp16ops.inc index ffa7d008168..07d5b47cd7a 100644 --- a/src/emu/cpu/dsp16/dsp16ops.inc +++ b/src/emu/cpu/dsp16/dsp16ops.inc @@ -361,8 +361,8 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& // TODO // LMV (mathematical overflow) - if ((result | U64(0xf00000000)) != U64(0xf00000000) && - (result | U64(0xf00000000)) != U64(0x000000000)) + if ((result & U64(0xf00000000)) != U64(0xf00000000) && + (result & U64(0xf00000000)) != U64(0x000000000)) m_psw |= 0x1000; else m_psw &= (~0x1000); diff --git a/src/emu/cpu/es5510/es5510.c b/src/emu/cpu/es5510/es5510.c index 9bdfd7ad373..086ed3450ed 100644 --- a/src/emu/cpu/es5510/es5510.c +++ b/src/emu/cpu/es5510/es5510.c @@ -600,8 +600,8 @@ void es5510_device::list_program(void(p)(const char *, ...)) { LOG(("ES5501: Starting!\n")); char buf[1024]; - bool is_written[0xff], is_read[0xff]; - char name[0xff][16]; + bool is_written[0x100], is_read[0x100]; + char name[0x100][16]; int addr; for (int i = 0; i < 0x100; i++) { diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index 9a375c80411..66d26e78aa1 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -677,8 +677,7 @@ static void m68k_presave(m68000_base_device *m68k) static void m68k_postload(m68000_base_device *m68k) { m68ki_set_sr_noint_nosp(m68k, m68k->save_sr); - m68k->stopped = m68k->save_stopped ? STOP_LEVEL_STOP : 0 - | m68k->save_halted ? STOP_LEVEL_HALT : 0; + m68k->stopped = (m68k->save_stopped ? STOP_LEVEL_STOP : 0) | (m68k->save_halted ? STOP_LEVEL_HALT : 0); m68ki_jump(m68k, REG_PC(m68k)); }