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:
Vadim Zeitlin
2012-09-15 23:20:23 +00:00
parent 42d7394119
commit daa3509726
9 changed files with 34 additions and 25 deletions

View File

@@ -1574,8 +1574,12 @@ wxString wxGetOSDirectory()
#ifdef __WXWINCE__
return wxString(wxT("\\Windows"));
#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__)
wxChar buf[256];
GetWindowsDirectory(buf, 256);
wxChar buf[MAX_PATH];
if ( !GetWindowsDirectory(buf, MAX_PATH) )
{
wxLogLastError(wxS("GetWindowsDirectory"));
}
return wxString(buf);
#elif defined(__WXMAC__) && wxOSX_USE_CARBON
return wxMacFindFolderNoSeparator(kOnSystemDisk, 'macs', false);