Вы находитесь на странице: 1из 6

WinMerge

: : 30.10.2010 , . , WinMerge. -

, , . , " , . " , . . 200 " CodeFest 2010 ( . . , . . . . . . , , . , . , , , , . , . , , , , , ). . . " . , . "if" . -

. . , ,

. , , , . , . . . . . . . . , WinMerge . ( 2.13.20 ( . PVS -Studio , , . . PVS-Studio 4.00. , 2.13.20 , . , . . 'Foo' is required to be utilized". .
/** * @brief Get the file names on both sides for specified item.

, . , . . , . ,

++,

. " , , ). 20.10.2010). . , ", ( 186000 ). , . 25% WinMerge.

. OpenMP . , 1-2

64. beta-

, (15 , , 15 ).

WinMerge .

"V530 - The return value of function :

* @note Return empty strings if item is special item. */ 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(); } else { ... } }

std::string::clear() , WinMerge:
/**

. std::string::empty(). .

, .

* @brief Clear variant's value (reset to defaults). */ void VariantValue::Clear() { m_vtype = VT_NULL; m_bvalue = false; m_ivalue = 0; m_fvalue = 0; m_svalue.empty(); m_tvalue = 0;

. "V501 - There are identical sub-expressions to the left and to the right of the '||' operator":
BUFFERTYPE m_nBufferType[2]; ... // Handle unnamed buffers if ((m_nBufferType[nBuffer] == BUFFER_UNNAMED) || (m_nBufferType[nBuffer] == BUFFER_UNNAMED)) nSaveErrorCode = SAVE_NO_FILENAME;

,
(m_nBufferType[0] == BUFFER_UNNAMED) || (m_nBufferType[1] == BUFFER_UNNAMED)

. WinMerge . , ,

, PVS-Studio class-type variable as 'N' actual argument".


String GetSysError(int nerr); ... CString msg; msg.Format(

. : "V510 - The 'Format' function is not expected to receive :

_T("Failed to open registry key HKCU/%s:\n\t%d : %s"), f_RegDir, retVal, GetSysError(retVal));

. , (Access Violation). "std::wstring".

"String" , " c_str():

"std::wstring".

".

msg.Format( _T("Failed to open registry key HKCU/%s: \n\t%d : %s"), f_RegDir, retVal, GetSysError(retVal).c_str());

. . , "if"

, . "V532 - The 'then' statement is :

equivalent to the 'else' statement".


if (max < INT_MAX) { for (i = min; i < max; i++) { if (eptr >= md->end_subject || IS_NEWLINE(eptr)) break; eptr++; while (eptr < md ->end_subject && (*eptr & 0xc0) == 0x80) eptr++; } } else { for (i = min; i < max; i++) { if (eptr >= md->end_subject || IS_NEWLINE(eptr)) break; eptr++; while (eptr < md ->end_subject && (*eptr & 0xc0) == 0x80) eptr++; } }

:"

- -

".

, . : "V534 - It is likely that a wrong variable is being compared inside the 'for' operator. Consider reviewing 'i'." :
// Get length of translated array of bytes from text. int Text2BinTranslator:: iLengthOfTransToBin( char* src, int srclen ) { ... for (k=i; i<srclen; k++) { if (src[k]=='>') break; } ... }

'>' .

Access Violation. 'srclen' 'i', 'k'.

. '>' ,

. . , . ,

Вам также может понравиться