PVS-StudioWarnings

PVS-Studio warning V523 for MAME

Nov 19th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. int compute_res_net(int inputs, int channel,
  2.                     const res_net_info *di)
  3. {
  4.   ...
  5.   if (OpenCol)
  6.   {
  7.     rTotal += 1.0 / di->rgb[channel].R[i];
  8.     v += vOL / di->rgb[channel].R[i];
  9.   }
  10.   else
  11.   {
  12.     rTotal += 1.0 / di->rgb[channel].R[i];
  13.     v += vOL / di->rgb[channel].R[i];
  14.   }
  15.   ...
  16. }
  17.  
  18. This suspicious code was found in MAME project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V523 The 'then' statement is equivalent to the 'else' statement.  resnet.c 628
  21.  
  22. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment