PVS-StudioWarnings

PVS-Studio warning V501 for LibRaw

Nov 19th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. void DHT::hide_hots() {
  2.   ....
  3.   for (int k = -2; k < 3; k += 2)
  4.     for (int m = -2; m < 3; m += 2)
  5.       if (m == 0 && m == 0)
  6.         continue;
  7.       else
  8.         avg += nraw[nr_offset(y + k, x + m)][kc];
  9.  
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in LibRaw project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V501 There are identical sub-expressions to the left and to the right of the '&&' operator: m == 0 && m == 0 dht_demosaic.cpp 260
  16.  
  17. 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