Advertisement
PVS-StudioWarnings

PVS-Studio warning V560 for Miranda IM

Nov 27th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam,
  2.                           LPARAM lParam )
  3. {
  4.   ...
  5.   DrawState(dis->hDC,NULL,NULL,(LPARAM)hIcon,0,
  6.     dis->rcItem.right+dis->rcItem.left-
  7.     GetSystemMetrics(SM_CXSMICON))/2+dx,
  8.     (dis->rcItem.bottom+dis->rcItem.top-
  9.     GetSystemMetrics(SM_CYSMICON))/2+dx,
  10.     0,0,
  11.     DST_ICON|
  12.     (dis->itemState&ODS_INACTIVE&&FALSE?
  13.      DSS_DISABLED:DSS_NORMAL));
  14.   ...
  15. }
  16.  
  17. There are some conditions which are always true or wrong. Most likely this was made on purpose (to disable some code branches), but in some fragments it looks strange. You may easily forget of fragments like this, for instance. By the way, this code is formatted. It's just one string in the program. How are you going to find this FALSE later?..
  18.  
  19. This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V560 A part of conditional expression is always false: 0.  clist_modern  modern_clui.cpp  2979
  22.  
  23. 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