Advertisement
PVS-StudioWarnings

PVS-Studio warning V649 for Wolf

Nov 20th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #define REFLAG_FULL_LOD     8   // force a FULL lod
  2. #define REFLAG_FORCE_LOD    8   // force a low lod
  3.  
  4. float R_CalcMDSLod(....)
  5. {
  6.   .....
  7.   if ( refent->reFlags & REFLAG_FULL_LOD )
  8.   {
  9.     return 1.0f;
  10.   }
  11.   ....
  12.   if ( refent->reFlags & REFLAG_FORCE_LOD )
  13.   {
  14.     flod *= 0.5;
  15.   }
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in Wolf project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V649 There are two 'if' statements with identical conditional expressions. The first 'if' statement contains function return. This means that the second 'if' statement is senseless. Check lines: 243, 262. tr_animation.c 262
  22.  
  23. 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
Advertisement