No changes, just silence some MSVC 11 static analyzer warnings.
This is an aborted attempt to make wxWidgets code compile without warnings
when using MSVC 11 /analyze option, as it was supposed to have become much
better. Unfortunately it still produces way too many false positives to be
really useful, in particular NULL pointer detection is completely broken as
even the code such as (from object.cpp):
wxClassInfo *info = sm_first;
while (info)
{
if ( info->m_next == this )
...
}
provokes tons of warnings about "info" being NULL inside the loop which is
clearly impossible.
So this commit just fixes a few obvious warnings, mostly about variable
shadowing but also a couple about possibly passing NULL to memcpy().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -514,7 +514,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const
|
||||
// (indirectly) set the year correctly
|
||||
while ( (nLostWeekDays % 7) != 0 )
|
||||
{
|
||||
nLostWeekDays += year++ % 4 ? 1 : 2;
|
||||
nLostWeekDays += (year++ % 4) ? 1 : 2;
|
||||
}
|
||||
|
||||
// finally move the year below 2000 so that the 2-digit
|
||||
@@ -1725,12 +1725,12 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
|
||||
if ( len > lenRest )
|
||||
continue;
|
||||
|
||||
const wxString::const_iterator pEnd = p + len;
|
||||
if ( wxString(p, pEnd).CmpNoCase(dateStr) == 0 )
|
||||
const wxString::const_iterator pEndStr = p + len;
|
||||
if ( wxString(p, pEndStr).CmpNoCase(dateStr) == 0 )
|
||||
{
|
||||
// nothing can follow this, so stop here
|
||||
|
||||
p = pEnd;
|
||||
p = pEndStr;
|
||||
|
||||
int dayDiffFromToday = literalDates[n].dayDiffFromToday;
|
||||
*this = Today();
|
||||
@@ -1739,7 +1739,7 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
|
||||
*this += wxDateSpan::Days(dayDiffFromToday);
|
||||
}
|
||||
|
||||
*end = pEnd;
|
||||
*end = pEndStr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user