Previous 199869 Revisions Next

r41612 Friday 6th November, 2015 at 13:02:51 UTC by Ryan Holtz
- Fix some instances of PVS-Studio warning V501, "There are identical sub-

 expressions to the left and to the right of an operator". [MooglyGuy]
[src/devices/cpu/alto2]a2emu.c
[src/devices/machine]hdc92x4.c
[src/devices/video]315_5313.c mos6566.c
[src/lib/formats]ap2_dsk.c
[src/osd/modules/opengl]gl_shader_tool.c

trunk/src/devices/cpu/alto2/a2emu.c
r250123r250124
606606      r = IR_SH(m_emu.ir) ^ 3;            /* complement of SH */
607607      LOG((this,LOG_EMU,2,"    IDISP<-; branch on SH^3 (%#o|%#o)\n", m_next2, r));
608608   } else {
609      int addr = CTL2K_U3(f2_emu_idisp) + X_RDBITS(m_emu.ir,16,1,7);
609      //int addr = CTL2K_U3(f2_emu_idisp) + X_RDBITS(m_emu.ir,16,1,7);
610        // The above line triggers the following warning in PVS-Studio:
611        // V501: There are identical sub-expressions to the left and to the right of the '==' operator: f2_emu_idisp == f2_emu_idisp
612        // This is because CTL2K_U3(f2) checks f2 == f2_emu_idisp, and so will always evaluate to true in this case.
613        // Consider checking if this is a typo or if it is correct.
614        int addr = 0x80 + X_RDBITS(m_emu.ir,16,1,7);
610615      /* 0???????xxxxxxxx */
611616      r = m_ctl2k_u3[addr];
612617      LOG((this,LOG_EMU,2,"    IDISP<-; IR (%#o) branch on PROM ctl2k_u3[%03o] (%#o|%#o)\n", m_emu.ir, addr, m_next2, r));
trunk/src/devices/machine/hdc92x4.c
r250123r250124
19111911   bool ismark = false;
19121912   if (using_floppy())
19131913   {
1914      if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode()? 0xf57e : 0x4489);
1914      if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode() ? 0xf57e : 0x4489);
19151915      else
19161916      {
19171917         // f56a    1x1x
trunk/src/devices/video/315_5313.c
r250123r250124
10221022 d0  - PAL mode flag
10231023*/
10241024
1025   return (0<<15) | // ALWAYS 0
1026         (0<<14) | // ALWAYS 0
1027         (1<<13) | // ALWAYS 1
1025   return (1<<13) | // ALWAYS 1
10281026         (1<<12) | // ALWAYS 1
1029         (0<<11) | // ALWAYS 0
10301027         (1<<10) | // ALWAYS 1
10311028         (fifo_empty<<9 ) | // FIFO EMPTY
10321029         (fifo_full<<8 ) | // FIFO FULL
trunk/src/devices/video/mos6566.c
r250123r250124
129129      } \
130130   } while (0)
131131
132#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))
132#define IS_PAL                  ((m_variant == TYPE_6569) || (m_variant == TYPE_6572) || (m_variant == TYPE_6573) || (m_variant == TYPE_8565) || (m_variant == TYPE_8569))
133133#define IS_VICIIE               ((m_variant == TYPE_8564) || (m_variant == TYPE_8566) || (m_variant == TYPE_8569))
134134
135135#define ROW25_YSTART      0x33
trunk/src/lib/formats/ap2_dsk.c
r250123r250124
16261626            odd = !odd;
16271627
16281628      int splice_byte = spos;
1629      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))
1629      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))
16301630         splice_byte++;
16311631      int splice = (npos[splice_byte+2]-1) % len;
16321632      if(odd)
trunk/src/osd/modules/opengl/gl_shader_tool.c
r250123r250124
6969
7070   if ( pfn_glGetObjectParameterivARB && pfn_glGetInfoLogARB && pfn_glDeleteObjectARB && pfn_glCreateShaderObjectARB &&
7171         pfn_glShaderSourceARB && pfn_glCompileShaderARB && pfn_glCreateProgramObjectARB && pfn_glAttachObjectARB &&
72         pfn_glLinkProgramARB && pfn_glValidateProgramARB && pfn_glUseProgramObjectARB && pfn_glGetUniformLocationARB &&
72         pfn_glLinkProgramARB && pfn_glValidateProgramARB && pfn_glUseProgramObjectARB &&
7373         pfn_glGetUniformLocationARB && pfn_glUniform1fARB && pfn_glUniform1iARB &&
7474         pfn_glUniform1fvARB && pfn_glUniform2fvARB && pfn_glUniform3fvARB && pfn_glUniform4fvARB &&
7575         pfn_glUniform1ivARB && pfn_glUniform2ivARB && pfn_glUniform3ivARB && pfn_glUniform4ivARB


Previous 199869 Revisions Next


© 1997-2024 The MAME Team