PVS-StudioWarnings

PVS-Studio warning V523 for ReactOS

Nov 13th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. void CardButton::DrawRect(HDC hdc, RECT *rect, bool fNormal)
  2. {
  3.   ...
  4.   HPEN hhi = CreatePen(0, 0, MAKE_PALETTERGB(crHighlight));
  5.   HPEN hsh = CreatePen(0, 0, MAKE_PALETTERGB(crShadow));
  6.   ...
  7.   if(fNormal)
  8.     hOld = SelectObject(hdc, hhi);
  9.   else
  10.     hOld = SelectObject(hdc, hhi);
  11.   ...
  12. }
  13.  
  14. Most likely this is what should be written here: else hOld = SelectObject(hdc, hsh);
  15.  
  16. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V523 The 'then' statement is equivalent to the 'else' statement. cardlib cardbutton.cpp 83
  19.  
  20. 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