PVS-StudioWarnings

PVS-Studio warning V525 for Miranda IM

Nov 18th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. static INT_PTR CALLBACK DlgProcTrayOpts(....)
  2. {
  3.   ...
  4.   EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),TRUE);
  5.   EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
  6.   EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
  7.   EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
  8.   EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
  9.   EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLE),FALSE);
  10.   EnableWindow(GetDlgItem(hwndDlg,IDC_MULTITRAY),FALSE);
  11.   ...
  12. }
  13.  
  14. The "IDC_ALWAYSPRIMARY" element is disabled twice. Perhaps some other element was intended to be disabled.
  15.  
  16. This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V525 The code containing the collection of similar blocks. Check items '1316', '1319', '1318', '1323', '1323', '1317', '1321' in lines 954, 955, 956, 957, 958, 959, 960. clist_modern modern_clcopts.cpp 954
  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