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

@@ -636,22 +636,23 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
extWithDot = wxT('.');
extWithDot += ext;
wxRegKey key(wxRegKey::HKCR, extWithDot);
if ( !key.Exists() ) key.Create();
key.SetValue(wxEmptyString, filetype);
wxRegKey key2(wxRegKey::HKCR, extWithDot);
if ( !key2.Exists() )
key2.Create();
key2.SetValue(wxEmptyString, filetype);
// now set any mimetypes we may have, but ignore it if none
const wxString& mimetype = ftInfo.GetMimeType();
if ( !mimetype.empty() )
const wxString& mimetype2 = ftInfo.GetMimeType();
if ( !mimetype2.empty() )
{
// set the MIME type
ok = key.SetValue(wxT("Content Type"), mimetype);
ok = key2.SetValue(wxT("Content Type"), mimetype2);
if ( ok )
{
// create the MIME key
wxString strKey = MIME_DATABASE_KEY;
strKey << mimetype;
strKey << mimetype2;
wxRegKey keyMIME(wxRegKey::HKCR, strKey);
ok = keyMIME.Create();