: : 20.04.2011
, .
" [1] , . . . . , ,
"
, . ,
y y y y y
eMule Plus
Visual Studio 237. PVS-Studio 68. 3. 4.
Visual Studio: warning C6054: String 'szwThemeFile' might not be zero-terminated. c:\emuleplus\dialogmintraybtn.hpp 445
WCHAR szwThemeFile[MAX_PATH]; WCHAR szwThemeColor[256]; if (m_themeHelper.GetCurrentThemeName (szwThemeFile, ARRSIZE(szwThemeFile), szwThemeColor, ARRSIZE(szwThemeColor), NULL, 0) != S_OK) return NULL; WCHAR *p; if ((p = wcsrchr(szwThemeFile, L' \\')) == NULL)
0, , .
Visual Studio: warning C6269: Possibly incorrect order of operations: dereference ignored. c:\emuleplus\customautocomplete.cpp 277
PVS-Studio: V532 Consider inspecting the statement of '*pointer++' pattern. Probably meant: '(*pointer)++'. customautocomplete.cpp 277
" .
" ,
(*ptr)++. ,
Visual Studio: warning C6298: Argument '6': using a read -only string as a writable string argument. This will attempt to write into static
, . . ? , . , ,
. ,
Visual Studio: warning C6314: Incorrect order of operations: bitwiseor has higher precedence than the conditional -expression operator. Add parentheses to clarify intent. c: \emuleplus\searchlistctrl.cpp 659
PVS-Studio: V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '|' operator. searchlistctrl.cpp 659
menuSearchFile.AppendMenu( MF_STRING | ((iSelectionMark != -1) && (dwSelectedCount > 0) && g_App.m_pServerConnect ->IsConnected() && ((pCurServer = g_App.m_pServerConnect ->GetCurrentServer())!= NULL)&& (pCurServer->GetTCPFlags() & SRV_TCPFLG_RELATEDSEARCH)) ? MF_ENABLED : MF_GRAYED, MP_SEARCHRELATED, GetResString(IDS_SEARCHRELATED) );
) ( ? ,
PVS-Studio: V519 The 'm_clrSample' object is assigned values twice successively. Perhaps this is a mistake. fontpreviewcombo.cpp 61
RGB(60,0,0)
Pixie
Visual Studio 18. PVS-Studio 65. 5. 0.
PVS-Studio: V519 The 'numRays' object is assigned values twice successively. Perhaps this is a mistake. bundles.cpp 579
, . ?
, ?
numRays . !
PVS-Studio: V501 There are identical sub -expressions to the left and to the right of the '|' operator: PARAMETER_DPDU | PARAMETER_DPDU
quadrics.cpp 880
, . " , ". -
. . , ,
PVS-Studio: V501 There are identical sub -expressions to the left and to the right of the '|' operator: SLC_VECTOR | SLC_VECTOR expression.cpp 2604
SLC_VECTOR
PVS-Studio: V505 The 'alloca' function is used inside the loop. This can quickly overflow stack. polygons.cpp 1120
inline ...
void
triangulatePolygon(...) {
alloca
VirtualDub
Visual Studio 24. PVS-Studio 41. 2. 0.
PVS-Studio: V547 Expression 'c < 0' is always false. Unsigned type value is never < 0. lexer.cpp 279
wint_t lexgetescape() { wint_t c = lexgetc(); if (c < 0) fatal("Newline found in escape sequence"); ... }
false.
PVS-Studio: V557 Array overrun is possible. The '9' index is pointing beyond array bound. f_convolute.cpp 73
long bias; void *dyna_func; DWORD dyna_size; DWORD dyna_old_protect; BOOL fClip; };
static unsigned long __fastcall do_conv( unsigned long *data, const ConvoluteFilterData *cfd, long sflags, long pit) { long rt0=cfd->m[9], gt0=cfd->m[9], bt0=cfd->m[9]; ... }
WinMerge
Visual Studio 343. PVS-Studio 69. 12. 3.
Visual Studio: warning C6313: Incorrect operator: zero -valued flag cannot be tested with bitwise-and. Use an equality test to check for zero-valued flags. c:\winmerge\src\bcmenu.cpp 1489
"
".
Visual Studio: warning C6287: Redundant code: the left and right sub-expressions are identical. c:\winmerge\src\editlib\ccrystaleditview.cpp 1560
PVS-Studio: V501 There are identical sub -expressions to the left and to the right of the '||' operator: c == '}' || c == '} ' ccrystaleditview.cpp 1560
. .
? "Copy-paste-technology",
Visual Studio: warning C6287: Redundant code: the left and right sub-expressions are identical. c: \winmerge\src\mergedoc.cpp 1165
PVS-Studio: V501 There are identical sub -expressions to the left and to the right of the '||' operator. mergedoc.cpp 1165
PVS-Studio: V551 The code under this 'case' label is unreacha ble. The value range of signed char type: [ -128, 127].
ccrystaltextview.cpp 1646
TCHAR ch = strText[i]; switch (ch) { case 0xB7: case 0xBB: strHTML += ch; strHTML += _T("<wbr>"); bLastCharSpace = FALSE; nNonbreakChars = 0; break;
, . char.
case . TCHAR
PVS-Studio: V524 It is odd that the body of 'IsValidTextPosX' function is fully equivalent to the body of 'IsValidTextPos' function (ccrystaltextview.cpp, line 3700). ccrystaltextview.cpp 3707
bool CCrystalTextView::IsValidTextPos (const CPoint &point) { return GetLineCount () > 0 && m_nTopLine >= 0 && m_nOffsetChar >= 0 && point.y >= 0 && point.y < GetLineCount () && point.x >= 0 && point.x <= GetLineLength (point.y); }
return GetLineCount () > 0 && m_nTopLine >= 0 && m_nOffsetChar >= 0 && point.y >= 0 && point.y < GetLineCount () && point.x >= 0 && point.x <= GetLineLength (point.y); }
bool CCrystalTextView::IsValidTextPosY (const CPoint &point) { return GetLineCount () > 0 && m_nTopLine >= 0 && m_nOffsetChar >= 0 && point.y >= 0 && point.y < GetLineCount (); }
... IsValidTextPosX() .
PVS-Studio: V563 It is possible that this 'else' branch must apply to the previous 'if' statement. bcmenu.cpp 1852
, ?
if
else?
PVS-Studio: V556 The values of different enum types are compared: switch(ENUM_TYPE_A) { case ENUM_TYPE_B: ... }. diffwrapper.cpp 956
enum switch.
PVS-Studio: V530 The return value of function 'empty' is required to be utilized. diractions.cpp 1307
void CDirView::GetItemFileNames(int sel, String& strLeft, String& strRight) const { UINT_PTR diffpos = GetItemKey(sel); if (diffpos == (UINT_PTR)SPECIAL_ITEM_POS) { strLeft.empty(); strRight.empty();
empty()
empty.
PVS-Studio: V524 It is odd that the body of 'OnUpdateLastdiff' function is fully equivalent to the body of 'OnUpdateFirstdiff' function (DirView.cpp, line 2189). dirview.cpp 2220
void CDirView::OnUpdateLastdiff(CCmdUI* pCmdUI) { int firstDiff = GetFirstDifferentItem(); if (firstDiff > -1) pCmdUI->Enable(TRUE); else
pCmdUI->Enable(FALSE); }
void CDirView::OnUpdateFirstdiff(CCmdUI* pCmdUI) { int firstDiff = GetFirstDifferentItem(); if (firstDiff > -1) pCmdUI->Enable(TRUE); else pCmdUI->Enable(FALSE); }
...
PVS-Studio: V501 There are identical sub -expressions 'pView1->GetTextBufferEol (line)' to the left and to the right of the '!=' operator. mergedoclinediffs.cpp 216
if (pView1->GetTextBufferEol(line) != pView1->GetTextBufferEol(line)) {
...
pView2.
PVS-Studio: V530 The return value of function 'empty' is required to be utilized. varprop.cpp 133
empty()
PVS-Studio: V510
String GetSysError(int nerr); ... CString msg; msg.Format( _T("Failed to open registry key HKCU/%s: \n\t%d : %s"), f_RegDir, retVal, GetSysError(retVal) );
PVS-Studio: V534 It is likely that a wrong variable is being compared inside the 'for' operator. Consider reviewing 'i'." BinTrans.cpp 357
// Get length of translated array of bytes from text. int Text2BinTranslator::iLengthOfTransToBin( char* src, int srclen ) { ... for (k=i; i<srclen; k++) {
. '>' . '>' , .
XUIFramework
Visual Studio 93. PVS-Studio 30. 5. 2.
Visual Studio: warning C6269: Possibly incorrect order of operations: dereference ignored c:\xui-gui framework\widgets\cstatichtml\ppdrawmanager.cpp 298
*ptr++.
Visual Studio: warning C6283: 'pBuffer' is allocated with array new[], but deleted with scalar delete. c:\xui-gui framework\widgets\cxstatic\cxstatic.cpp 544
delete delete[]. .
PVS-Studio: V519 The 'm_xSt' object is assigned values twice successively. Perhaps this is a mistake. resizedlg.cpp 244
m_ySt.
sizeof(szTemp) / sizeof(TCHAR) .
PVS-Studio: V556 The values of different enum types are compared: enuHAlign == Center. cxstatic.cpp 151
if (enuHAlign == Center)
Center.
if (enuVAlign == Middle), .
PVS-Studio: V501 There are identical sub -expressions to the left and to the right of the '||' operator. resizedlg.cpp 157
HDWP CItemCtrl::OnSize(...) { ... if (m_styTop == CST_ZOOM || m_styTop == CST_DELTA_ZOOM || m_styBottom == CST_ZOOM || m_styBottom == CST_DELTA_ZOOM) ... }
. , .
1.
. . http://www.viva64.com/ru/a/0071/.