From 932910a75eaa1493e6e4180c29b2c7f9f8f3e3c2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 May 2012 11:43:57 +0000 Subject: [PATCH] fixed some "comparison is always true/false" warnings reported by clang by Firewave in timer.c I have commented not removed lines that are always false --- src/emu/cpu/v60/op12.c | 4 ++-- src/emu/machine/idectrl.c | 4 ++-- src/emu/timer.c | 8 ++++---- src/mame/machine/archimds.c | 2 +- src/mame/machine/megavdp.c | 2 +- src/osd/sdl/sdlwork.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/emu/cpu/v60/op12.c b/src/emu/cpu/v60/op12.c index b73c3f81f68..ef5944cdfda 100644 --- a/src/emu/cpu/v60/op12.c +++ b/src/emu/cpu/v60/op12.c @@ -753,7 +753,7 @@ static UINT32 opINW(v60_state *cpustate) static UINT32 opLDPR(v60_state *cpustate) { F12DecodeOperands(cpustate, ReadAMAddress, 2,ReadAM, 2); - if (cpustate->op2 >= 0 && cpustate->op2 <= 28) + if (cpustate->op2 <= 28) { if (cpustate->flag1 &&(!(OpRead8(cpustate, cpustate->PC + 1)&0x80 && OpRead8(cpustate, cpustate->PC + 2) == 0xf4 ) )) cpustate->reg[cpustate->op2 + 36] = cpustate->reg[cpustate->op1]; @@ -2096,7 +2096,7 @@ static UINT32 opSHLW(v60_state *cpustate) /* TRUSTED */ static UINT32 opSTPR(v60_state *cpustate) { F12DecodeFirstOperand(cpustate, ReadAM, 2); - if (cpustate->op1 >= 0 && cpustate->op1 <= 28) + if (cpustate->op1 <= 28) cpustate->modwritevalw = cpustate->reg[cpustate->op1 + 36]; else { diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index d1db1baab84..5f3e5709ed3 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -1746,7 +1746,7 @@ READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r ) offset *= 4; size = convert_to_offset_and_size32(&offset, mem_mask); - if (offset >= 0x000 && offset < 0x008) + if (offset < 0x008) res = ide_controller_read(device, 0, offset & 7, size); if (offset >= 0x008 && offset < 0x010) res = ide_controller_read(device, 1, offset & 7, size); @@ -1763,7 +1763,7 @@ WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w ) size = convert_to_offset_and_size32(&offset, mem_mask); data = data >> ((offset & 3) * 8); - if (offset >= 0x000 && offset < 0x008) + if (offset < 0x008) ide_controller_write(device, 0, offset & 7, size, data); if (offset >= 0x008 && offset < 0x010) ide_controller_write(device, 1, offset & 7, size, data); diff --git a/src/emu/timer.c b/src/emu/timer.c index 2eefaddb97b..607e4eaad3d 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -199,10 +199,10 @@ void timer_device::device_validity_check(validity_checker &valid) const mame_printf_warning("Scanline timer specified parameters for a periodic timer\n"); if (m_param != 0) mame_printf_warning("Scanline timer specified parameter which is ignored\n"); - if (m_first_vpos < 0) - mame_printf_error("Scanline timer specified invalid initial position\n"); - if (m_increment < 0) - mame_printf_error("Scanline timer specified invalid increment\n"); +// if (m_first_vpos < 0) +// mame_printf_error("Scanline timer specified invalid initial position\n"); +// if (m_increment < 0) +// mame_printf_error("Scanline timer specified invalid increment\n"); break; default: diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c index d8f0c0e4ab7..e26f587c72d 100644 --- a/src/mame/machine/archimds.c +++ b/src/mame/machine/archimds.c @@ -855,7 +855,7 @@ WRITE32_HANDLER(archimedes_vidc_w) // 0x00 - 0x3c Video Palette Logical Colors (16 colors) // 0x40 Border Color // 0x44 - 0x4c Cursor Palette Logical Colors - if (reg >= 0x00 && reg <= 0x4c) + if (reg <= 0x4c) { int r,g,b; diff --git a/src/mame/machine/megavdp.c b/src/mame/machine/megavdp.c index 904fca5083c..983d7274f18 100644 --- a/src/mame/machine/megavdp.c +++ b/src/mame/machine/megavdp.c @@ -436,7 +436,7 @@ UINT16 vdp_get_word_from_68k_mem_default(running_machine &machine, UINT32 source //printf("vdp_get_word_from_68k_mem_default %08x\n", source); - if (( source >= 0x000000 ) && ( source <= 0x3fffff )) + if ( source <= 0x3fffff ) { if (_svp_cpu != NULL) { diff --git a/src/osd/sdl/sdlwork.c b/src/osd/sdl/sdlwork.c index c2798b17752..74cb625d755 100644 --- a/src/osd/sdl/sdlwork.c +++ b/src/osd/sdl/sdlwork.c @@ -310,7 +310,7 @@ int osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout) void osd_work_queue_free(osd_work_queue *queue) { // if we have threads, clean them up - if (queue->threads >= 0 && queue->thread != NULL) + if (queue->thread != NULL) { int threadnum;