PVS-StudioWarnings

PVS-Studio warning V501 for Lugaru

Nov 17th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. int Game::DrawGLScene(void)
  2. {
  3.   ...
  4.   if(freeze||winfreeze||(mainmenu&&gameon)||
  5.      (!gameon&&gamestarted)||(mainmenu&&gameon)||
  6.      (!gameon&&gamestarted)||(!gameon&&gamestarted))
  7.   {
  8.     multiplier=tempmult;
  9.   }
  10.   ...
  11. }
  12.  
  13. This suspicious code was found in Lugaru project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V501 There are identical sub-expressions '(mainmenu && gameon)' to the left and to the right of the '||' operator. Lugaru gamedraw.cpp 2237
  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