Advertisement
PVS-StudioWarnings

PVS-Studio warning V560 for MTASA

Nov 24th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. SColor C3DMarkerSA::GetColor()
  2. {
  3.   DEBUG_TRACE("RGBA C3DMarkerSA::GetColor()");
  4.   // From ABGR
  5.   unsigned long ulABGR = this->GetInterface()->rwColour;
  6.   SColor color;
  7.   color.A = ( ulABGR >> 24 ) && 0xff;
  8.   color.B = ( ulABGR >> 16 ) && 0xff;
  9.   color.G = ( ulABGR >> 8 ) && 0xff;
  10.   color.R = ulABGR && 0xff;
  11.   return color;
  12. }
  13.  
  14. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V560 A part of conditional expression is always true: 0xff. c3dmarkersa.cpp 78
  17.  
  18. 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