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
This commit is contained in:
Miodrag Milanovic 2012-05-20 11:43:57 +00:00
parent 32dc4f4d53
commit 932910a75e
6 changed files with 11 additions and 11 deletions

View File

@ -753,7 +753,7 @@ static UINT32 opINW(v60_state *cpustate)
static UINT32 opLDPR(v60_state *cpustate) static UINT32 opLDPR(v60_state *cpustate)
{ {
F12DecodeOperands(cpustate, ReadAMAddress, 2,ReadAM, 2); 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 ) )) if (cpustate->flag1 &&(!(OpRead8(cpustate, cpustate->PC + 1)&0x80 && OpRead8(cpustate, cpustate->PC + 2) == 0xf4 ) ))
cpustate->reg[cpustate->op2 + 36] = cpustate->reg[cpustate->op1]; 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) static UINT32 opSTPR(v60_state *cpustate)
{ {
F12DecodeFirstOperand(cpustate, ReadAM, 2); F12DecodeFirstOperand(cpustate, ReadAM, 2);
if (cpustate->op1 >= 0 && cpustate->op1 <= 28) if (cpustate->op1 <= 28)
cpustate->modwritevalw = cpustate->reg[cpustate->op1 + 36]; cpustate->modwritevalw = cpustate->reg[cpustate->op1 + 36];
else else
{ {

View File

@ -1746,7 +1746,7 @@ READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r )
offset *= 4; offset *= 4;
size = convert_to_offset_and_size32(&offset, mem_mask); 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); res = ide_controller_read(device, 0, offset & 7, size);
if (offset >= 0x008 && offset < 0x010) if (offset >= 0x008 && offset < 0x010)
res = ide_controller_read(device, 1, offset & 7, size); 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); size = convert_to_offset_and_size32(&offset, mem_mask);
data = data >> ((offset & 3) * 8); data = data >> ((offset & 3) * 8);
if (offset >= 0x000 && offset < 0x008) if (offset < 0x008)
ide_controller_write(device, 0, offset & 7, size, data); ide_controller_write(device, 0, offset & 7, size, data);
if (offset >= 0x008 && offset < 0x010) if (offset >= 0x008 && offset < 0x010)
ide_controller_write(device, 1, offset & 7, size, data); ide_controller_write(device, 1, offset & 7, size, data);

View File

@ -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"); mame_printf_warning("Scanline timer specified parameters for a periodic timer\n");
if (m_param != 0) if (m_param != 0)
mame_printf_warning("Scanline timer specified parameter which is ignored\n"); mame_printf_warning("Scanline timer specified parameter which is ignored\n");
if (m_first_vpos < 0) // if (m_first_vpos < 0)
mame_printf_error("Scanline timer specified invalid initial position\n"); // mame_printf_error("Scanline timer specified invalid initial position\n");
if (m_increment < 0) // if (m_increment < 0)
mame_printf_error("Scanline timer specified invalid increment\n"); // mame_printf_error("Scanline timer specified invalid increment\n");
break; break;
default: default:

View File

@ -855,7 +855,7 @@ WRITE32_HANDLER(archimedes_vidc_w)
// 0x00 - 0x3c Video Palette Logical Colors (16 colors) // 0x00 - 0x3c Video Palette Logical Colors (16 colors)
// 0x40 Border Color // 0x40 Border Color
// 0x44 - 0x4c Cursor Palette Logical Colors // 0x44 - 0x4c Cursor Palette Logical Colors
if (reg >= 0x00 && reg <= 0x4c) if (reg <= 0x4c)
{ {
int r,g,b; int r,g,b;

View File

@ -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); //printf("vdp_get_word_from_68k_mem_default %08x\n", source);
if (( source >= 0x000000 ) && ( source <= 0x3fffff )) if ( source <= 0x3fffff )
{ {
if (_svp_cpu != NULL) if (_svp_cpu != NULL)
{ {

View File

@ -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) void osd_work_queue_free(osd_work_queue *queue)
{ {
// if we have threads, clean them up // if we have threads, clean them up
if (queue->threads >= 0 && queue->thread != NULL) if (queue->thread != NULL)
{ {
int threadnum; int threadnum;