]> git.saurik.com Git - wxWidgets.git/commitdiff
work around some (harmless) g++ warnings about possibly uninitalized variables
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Mar 2009 13:57:05 +0000 (13:57 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Mar 2009 13:57:05 +0000 (13:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/event.cpp
src/html/m_tables.cpp

index 461b6fe5e783ace86af812afe81ab06ebbc988d8..2a4ff7954eb41a67415195d9141421743cbcb563 100644 (file)
@@ -1394,9 +1394,15 @@ bool wxEvtHandler::SafelyProcessEvent(wxEvent& event)
     }
     catch ( ... )
     {
-        wxEventLoopBase *loop = wxEventLoopBase::GetActive();
+        // notice that we do it in 2 steps to avoid warnings about possibly
+        // uninitialized loop variable from some versions of g++ which are not
+        // smart enough to figure out that GetActive() doesn't throw and so
+        // that loop will always be initialized
+        wxEventLoopBase *loop = NULL;
         try
         {
+            loop = wxEventLoopBase::GetActive();
+
             if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() )
             {
                 if ( loop )
index b111abed671f25409ba24918ca653718dd61d994..d1971d0fb1bd04c640f8ddd328feb47afbee2069 100644 (file)
@@ -769,7 +769,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
                 m_WParser->OpenContainer();
 
                 // the header should be rendered in bold by default
-                int boldOld wxDUMMY_INITIALIZE(0);
+                int boldOld = 0;
                 if ( isHeader )
                 {
                     boldOld = m_WParser->GetFontBold();