Advertisement
PVS-StudioWarnings

PVS-Studio warning V583 for Cocos2d-x

Nov 21st, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. spAtlas* spAtlas_readAtlas (....)
  2. {
  3.   ....
  4.   page->uWrap = *str.begin == 'x' ? ATLAS_REPEAT :
  5.     (*str.begin == 'y' ? ATLAS_CLAMPTOEDGE : ATLAS_REPEAT);
  6.   page->vWrap = *str.begin == 'x' ? ATLAS_CLAMPTOEDGE :
  7.     (*str.begin == 'y' ? ATLAS_REPEAT : ATLAS_REPEAT);     //<==
  8.   ....
  9. }
  10.  
  11. This suspicious code was found in Cocos2d-x project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V583 The '?:' operator, regardless of its conditional expression, always returns one and the same value: ATLAS_REPEAT. atlas.cpp 219
  14.  
  15. 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