Advertisement
PVS-StudioWarnings

PVS-Studio warning V519 for ReactOS

Nov 24th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. HPALETTE CardWindow::CreateCardPalette()
  2. {
  3.   ...
  4.   //include button text colours
  5.   cols[0] = RGB(0, 0, 0);
  6.   cols[1] = RGB(255, 255, 255);
  7.  
  8.   //include the base background colour
  9.   cols[1] = crBackgnd;
  10.  
  11.   //include the standard button colours...
  12.   cols[3] = CardButton::GetHighlight(crBackgnd);
  13.   cols[4] = CardButton::GetShadow(crBackgnd);
  14.   cols[5] = CardButton::GetFace(crBackgnd);
  15.   ...
  16. }
  17.  
  18. Most likely this is what should be written here: cols[2] = crBackgnd;
  19.  
  20. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V519 The 'cols [1]' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 716, 719. cardlib cardwindow.cpp 719
  23.  
  24. 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