- Fix some instances of PVS-Studio warning V501, "There are identical sub-

expressions to the left and to the right of an operator". [MooglyGuy]
This commit is contained in:
therealmogminer@gmail.com 2015-11-06 14:02:51 +01:00
parent bcafd15b09
commit 52fa9421b9
6 changed files with 11 additions and 9 deletions

View File

@ -606,7 +606,12 @@ void alto2_cpu_device::f2_late_idisp()
r = IR_SH(m_emu.ir) ^ 3; /* complement of SH */
LOG((this,LOG_EMU,2," IDISP<-; branch on SH^3 (%#o|%#o)\n", m_next2, r));
} else {
int addr = CTL2K_U3(f2_emu_idisp) + X_RDBITS(m_emu.ir,16,1,7);
//int addr = CTL2K_U3(f2_emu_idisp) + X_RDBITS(m_emu.ir,16,1,7);
// The above line triggers the following warning in PVS-Studio:
// V501: There are identical sub-expressions to the left and to the right of the '==' operator: f2_emu_idisp == f2_emu_idisp
// This is because CTL2K_U3(f2) checks f2 == f2_emu_idisp, and so will always evaluate to true in this case.
// Consider checking if this is a typo or if it is correct.
int addr = 0x80 + X_RDBITS(m_emu.ir,16,1,7);
/* 0???????xxxxxxxx */
r = m_ctl2k_u3[addr];
LOG((this,LOG_EMU,2," IDISP<-; IR (%#o) branch on PROM ctl2k_u3[%03o] (%#o|%#o)\n", m_emu.ir, addr, m_next2, r));

View File

@ -1911,7 +1911,7 @@ bool hdc92x4_device::found_mark(int state)
bool ismark = false;
if (using_floppy())
{
if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode()? 0xf57e : 0x4489);
if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode() ? 0xf57e : 0x4489);
else
{
// f56a 1x1x

View File

@ -1022,11 +1022,8 @@ UINT16 sega315_5313_device::ctrl_port_r()
d0 - PAL mode flag
*/
return (0<<15) | // ALWAYS 0
(0<<14) | // ALWAYS 0
(1<<13) | // ALWAYS 1
return (1<<13) | // ALWAYS 1
(1<<12) | // ALWAYS 1
(0<<11) | // ALWAYS 0
(1<<10) | // ALWAYS 1
(fifo_empty<<9 ) | // FIFO EMPTY
(fifo_full<<8 ) | // FIFO FULL

View File

@ -129,7 +129,7 @@ static const rgb_t PALETTE_MOS[] =
} \
} while (0)
#define IS_PAL ((m_variant == TYPE_6569) || (m_variant == TYPE_6572) || (m_variant == TYPE_6573) || (m_variant == TYPE_8565) || (m_variant == TYPE_8565) || (m_variant == TYPE_8569))
#define IS_PAL ((m_variant == TYPE_6569) || (m_variant == TYPE_6572) || (m_variant == TYPE_6573) || (m_variant == TYPE_8565) || (m_variant == TYPE_8569))
#define IS_VICIIE ((m_variant == TYPE_8564) || (m_variant == TYPE_8566) || (m_variant == TYPE_8569))
#define ROW25_YSTART 0x33

View File

@ -1626,7 +1626,7 @@ bool a2_edd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
odd = !odd;
int splice_byte = spos;
while(splice_byte < spos+delta && (npos[splice_byte+1] - npos[splice_byte] != 8 || npos[splice_byte+2] - npos[splice_byte+1] == 8 || npos[splice_byte+2] - npos[splice_byte+2] == 8))
while(splice_byte < spos+delta && (npos[splice_byte+1] - npos[splice_byte] != 8 || npos[splice_byte+2] - npos[splice_byte+1] == 8 || npos[splice_byte+3] - npos[splice_byte+2] == 8))
splice_byte++;
int splice = (npos[splice_byte+2]-1) % len;
if(odd)

View File

@ -69,7 +69,7 @@ int gl_shader_loadExtention(osd_gl_context *gl_ctx)
if ( pfn_glGetObjectParameterivARB && pfn_glGetInfoLogARB && pfn_glDeleteObjectARB && pfn_glCreateShaderObjectARB &&
pfn_glShaderSourceARB && pfn_glCompileShaderARB && pfn_glCreateProgramObjectARB && pfn_glAttachObjectARB &&
pfn_glLinkProgramARB && pfn_glValidateProgramARB && pfn_glUseProgramObjectARB && pfn_glGetUniformLocationARB &&
pfn_glLinkProgramARB && pfn_glValidateProgramARB && pfn_glUseProgramObjectARB &&
pfn_glGetUniformLocationARB && pfn_glUniform1fARB && pfn_glUniform1iARB &&
pfn_glUniform1fvARB && pfn_glUniform2fvARB && pfn_glUniform3fvARB && pfn_glUniform4fvARB &&
pfn_glUniform1ivARB && pfn_glUniform2ivARB && pfn_glUniform3ivARB && pfn_glUniform4ivARB