Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define IDC_KEYWORD1_ITALIC_CHECK (IDC_KEYWORD1 + 7)
- #define IDC_KEYWORD3_BOLD_CHECK (IDC_KEYWORD3 + 6)
- void KeyWordsStyleDialog::updateDlg()
- {
- ...
- Style & w1Style =
- _pUserLang->_styleArray.getStyler(STYLE_WORD1_INDEX);
- styleUpdate(w1Style, _pFgColour[0], _pBgColour[0],
- IDC_KEYWORD1_FONT_COMBO, IDC_KEYWORD1_FONTSIZE_COMBO,
- IDC_KEYWORD1_BOLD_CHECK, IDC_KEYWORD1_ITALIC_CHECK,
- IDC_KEYWORD1_UNDERLINE_CHECK);
- Style & w2Style =
- _pUserLang->_styleArray.getStyler(STYLE_WORD2_INDEX);
- styleUpdate(w2Style, _pFgColour[1], _pBgColour[1],
- IDC_KEYWORD2_FONT_COMBO, IDC_KEYWORD2_FONTSIZE_COMBO,
- IDC_KEYWORD2_BOLD_CHECK, IDC_KEYWORD2_ITALIC_CHECK,
- IDC_KEYWORD2_UNDERLINE_CHECK);
- Style & w3Style =
- _pUserLang->_styleArray.getStyler(STYLE_WORD3_INDEX);
- styleUpdate(w3Style, _pFgColour[2], _pBgColour[2],
- IDC_KEYWORD3_FONT_COMBO, IDC_KEYWORD3_FONTSIZE_COMBO,
- IDC_KEYWORD3_BOLD_CHECK, IDC_KEYWORD3_BOLD_CHECK,
- IDC_KEYWORD3_UNDERLINE_CHECK);
- Style & w4Style =
- _pUserLang->_styleArray.getStyler(STYLE_WORD4_INDEX);
- styleUpdate(w4Style, _pFgColour[3], _pBgColour[3],
- IDC_KEYWORD4_FONT_COMBO, IDC_KEYWORD4_FONTSIZE_COMBO,
- IDC_KEYWORD4_BOLD_CHECK, IDC_KEYWORD4_ITALIC_CHECK,
- IDC_KEYWORD4_UNDERLINE_CHECK);
- ...
- }
- This code was most likely being written through the Copy-Paste method. It resulted in using IDC_KEYWORD3_BOLD_CHECK instead of IDC_KEYWORD3_ITALIC_CHECK. The warning looks a bit strange, telling us about the numbers '7', '7', '6', '7'. Unfortunately, a clearer message cannot be generated.
- This suspicious code was found in Notepad++ project by PVS-Studio static code analyzer.
- Warning message is:
- V525 The code containing the collection of similar blocks. Check items '7', '7', '6', '7' in lines 576, 580, 584, 588
- 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