]> git.saurik.com Git - wxWidgets.git/commitdiff
various warning fixes for icc 9.1 compilation
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Sep 2007 12:00:25 +0000 (12:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 21 Sep 2007 12:00:25 +0000 (12:00 +0000)
- variable shadowing
- unused code and variables
- extra semicolons

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

15 files changed:
src/common/imagiff.cpp
src/common/sizer.cpp
src/generic/collpaneg.cpp
src/generic/filectrlg.cpp
src/generic/scrlwing.cpp
src/generic/srchctlg.cpp
src/gtk/collpane.cpp
src/gtk/combobox.cpp
src/gtk/filectrl.cpp
src/gtk/gnome/gprint.cpp
src/gtk/scrolbar.cpp
src/gtk/tbargtk.cpp
src/gtk/textctrl.cpp
src/gtk/window.cpp
src/unix/appunix.cpp

index 311fcadfbb6e402d4b9a743029a19e462426551b..058d6e5cd0bb0e1409edb0d4e36cd30468e302c2 100644 (file)
@@ -379,22 +379,15 @@ int wxIFFDecoder::ReadIFF()
     // main decoding loop. searches IFF chunks and handles them.
     // terminates when BODY chunk was found or dataptr ran over end of file
     //
-    bool BMHDok = false, CMAPok = false, CAMGok = false;
+    bool BMHDok = false, CAMGok = false;
     int bmhd_width = 0, bmhd_height = 0, bmhd_bitplanes = 0, bmhd_transcol = -1;
-    byte bmhd_masking = 0, bmhd_compression = 0;
+    byte bmhd_compression = 0;
     long camg_viewmode = 0;
     int colors = 0;
     while (dataptr + 8 <= dataend) {
     // get chunk length and make even
-    size_t chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe;
-#ifdef __VMS
-       // Silence compiler warning
-       int chunkLen_;
-       chunkLen_ = chunkLen;
-       if (chunkLen_ < 0) {     // format error?
-#else
-       if (chunkLen < 0) {     // format error?
-#endif
+    long chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe;
+    if (chunkLen < 0) {     // format error?
          break;
     }
     bool truncated = (dataptr + 8 + chunkLen > dataend);
@@ -406,7 +399,7 @@ int wxIFFDecoder::ReadIFF()
         bmhd_width = iff_getword(dataptr + 8);      // width of picture
         bmhd_height= iff_getword(dataptr + 8 + 2);  // height of picture
         bmhd_bitplanes = *(dataptr + 8 + 8);        // # of bitplanes
-        bmhd_masking  = *(dataptr + 8 + 9);
+        // bmhd_masking  = *(dataptr + 8 + 9); -- unused currently
         bmhd_compression = *(dataptr + 8 + 10);     // get compression
         bmhd_transcol    = iff_getword(dataptr + 8 + 12);
         BMHDok = true;                              // got BMHD
@@ -440,7 +433,6 @@ int wxIFFDecoder::ReadIFF()
         wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."),
             colors);
 
-        CMAPok = true;                              // got CMAP
         dataptr += 8 + chunkLen;                    // to next chunk
     } else if (strncmp((char *)dataptr, "CAMG", 4) == 0) { // CAMG ?
         if (chunkLen < 4 || truncated) {
index ed30da1d39f2bc6cb14791022fcfd1f0f0a623b5..9dde5b581bca5b6f89a6bd667bdf4bb1f6d46e97 100644 (file)
@@ -1376,8 +1376,8 @@ wxFlexGridSizer::~wxFlexGridSizer()
 
 void wxFlexGridSizer::RecalcSizes()
 {
-    int nitems, nrows, ncols;
-    if ( (nitems = CalcRowsCols(nrows, ncols)) == 0 )
+    int nrows, ncols;
+    if ( !CalcRowsCols(nrows, ncols) )
         return;
 
     const wxPoint pt(GetPosition());
index f31a7762c7378667b5fec2eb1db838f48e6cf1f6..ae5f0cde3c20ac7a50e541ce5ed98ff2802c0d6c 100644 (file)
@@ -184,11 +184,11 @@ void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz)
                 if (top->GetSizer())
                 {
                     // we have just set the size hints...
-                    wxSize sz = top->GetSizer()->CalcMin();
+                    wxSize szClient = top->GetSizer()->CalcMin();
 
                     // use SetClientSize() and not SetSize() otherwise the size for
                     // e.g. a wxFrame with a menubar wouldn't be correctly set
-                    top->SetClientSize(sz);
+                    top->SetClientSize(szClient);
                 }
                 else
                     top->Layout();
index f85cf1d342d3d738860568b5cd77de8634e4d6ce..5427143e0121267ac1d39c42580bdc405979a05c 100644 (file)
@@ -393,9 +393,6 @@ void wxFileData::MakeItem( wxListItem &item )
 //  wxFileListCtrl
 //-----------------------------------------------------------------------------
 
-// FIXME: what is this for? It's never read
-static bool ignoreChanges = false;
-
 IMPLEMENT_DYNAMIC_CLASS(wxFileListCtrl,wxListCtrl)
 
 BEGIN_EVENT_TABLE(wxFileListCtrl,wxListCtrl)
@@ -722,10 +719,8 @@ void wxFileListCtrl::GoToParentDir()
         long id = FindItem( 0, fname );
         if (id != wxNOT_FOUND)
         {
-            ignoreChanges = true;
             SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
             EnsureVisible( id );
-            ignoreChanges = false;
         }
     }
 }
@@ -743,9 +738,7 @@ void wxFileListCtrl::GoToDir( const wxString &dir )
     m_dirName = dir;
     UpdateFiles();
 
-    ignoreChanges = true;
     SetItemState( 0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
-    ignoreChanges = false;
 
     EnsureVisible( 0 );
 }
@@ -818,9 +811,7 @@ void wxFileListCtrl::OnListEndLabelEdit( wxListEvent &event )
     {
         fd->SetNewName( new_name, event.GetLabel() );
 
-        ignoreChanges = true;
         SetItemState( event.GetItem(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
-        ignoreChanges = false;
 
         UpdateItem( event.GetItem() );
         EnsureVisible( event.GetItem() );
index ee25469cc65c05ac9fb34de8ccf61a81a8c13695..4d4c52bc701f7a64c6ba46e96705a3905fed2961 100644 (file)
@@ -1188,18 +1188,18 @@ void wxScrollHelper::HandleOnChar(wxKeyEvent& event)
 
     if ( m_xScrollPosition != xScrollOld )
     {
-        wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition,
+        wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition,
                                wxHORIZONTAL);
-        event.SetEventObject(m_win);
-        m_win->GetEventHandler()->ProcessEvent(event);
+        evt.SetEventObject(m_win);
+        m_win->GetEventHandler()->ProcessEvent(evt);
     }
 
     if ( m_yScrollPosition != yScrollOld )
     {
-        wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition,
+        wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition,
                                wxVERTICAL);
-        event.SetEventObject(m_win);
-        m_win->GetEventHandler()->ProcessEvent(event);
+        evt.SetEventObject(m_win);
+        m_win->GetEventHandler()->ProcessEvent(evt);
     }
 }
 
index fc5adf6dee80f9b7cc0232ce6e0a88ab4c51a85c..b12fe8e6ae326aa2dd8a3afcdd7b0b0ab29180a1 100644 (file)
@@ -342,8 +342,6 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
     m_text = new wxSearchTextCtrl(this, value, style & ~wxBORDER_MASK);
     m_text->SetDescriptiveText(_("Search"));
 
-    wxSize sizeText = m_text->GetBestSize();
-
     m_searchButton = new wxSearchButton(this,
                                         wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,
                                         m_searchBitmap);
index e616adb537bd9f399c12878c7adef6652d8c30a6..b5fd6511b5fee9a726c053e85096298444bbe860 100644 (file)
@@ -96,7 +96,7 @@ static void gtk_collapsiblepane_expanded_callback (GObject    *object,
         // fire an event
         wxCollapsiblePaneEvent ev(p, p->GetId(), p->IsCollapsed());
         p->GetEventHandler()->ProcessEvent(ev);
-    
+
         // the user asked to explicitely handle the resizing itself...
         return;
     }
@@ -106,7 +106,7 @@ static void gtk_collapsiblepane_expanded_callback (GObject    *object,
     if ( top && top->GetSizer() )
     {
         // 2) recalculate minimal size of the top window
-        wxSize sz = top->GetSizer()->CalcMin();
+        sz = top->GetSizer()->CalcMin();
 
         if (top->m_mainWidget)
         {
index 91207fc70a763bd145aba1b853685fbe186722c6..d36c8abf44d97b7969a013f30a5fd40d2a817747 100644 (file)
@@ -775,8 +775,6 @@ unsigned int wxComboBox::GetCount() const
         }
         return count;
     }
-
-    return 0;
 }
 
 void wxComboBox::SetSelection( int n )
index 6b2a0001df1e39d83c3bbad67df3ef70afd46ffc..c8b852d36dd4fe63b758b7e2a84a25dd9a05b638 100644 (file)
@@ -194,7 +194,7 @@ int wxGtkFileChooser::GetFilterIndex() const
     }
     else
         return index;
-};
+}
 
 //-----------------------------------------------------------------------------
 // end wxGtkFileChooser Implementation
index 8b7eef989ad6f8ff653e70d7edb8c6be7a7f2fd0..993cba21956fd85b340455b9d54eafc55705cd12 100644 (file)
@@ -1031,10 +1031,10 @@ void wxGnomePrintDC::DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoo
         alpha1 = 0.0;
         alpha2 = 360.0;
     }
-    else
-    if (radius == 0.0)
+    else if ( wxIsNullDouble(radius) )
     {
-        alpha1 = alpha2 = 0.0;
+        alpha1 =
+        alpha2 = 0.0;
     }
     else
     {
@@ -1161,8 +1161,8 @@ void wxGnomePrintDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxC
         int i;
         for (i = 1; i < n; i++)
         {
-            int x = points[i].x + xoffset;
-            int y = points[i].y + yoffset;
+            x = points[i].x + xoffset;
+            y = points[i].y + yoffset;
             gs_libGnomePrint->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
             CalcBoundingBox( x, y );
         }
@@ -1181,8 +1181,8 @@ void wxGnomePrintDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxC
         int i;
         for (i = 1; i < n; i++)
         {
-            int x = points[i].x + xoffset;
-            int y = points[i].y + yoffset;
+            x = points[i].x + xoffset;
+            y = points[i].y + yoffset;
             gs_libGnomePrint->gnome_print_lineto( m_gpc, XLOG2DEV(x), YLOG2DEV(y) );
             CalcBoundingBox( x, y );
         }
index 343e27f8489d17a082ead4525ae07160b60e1d47..a9aa6021e9f51627f11c2a5d09803e26da7b530c 100644 (file)
@@ -33,14 +33,19 @@ gtk_value_changed(GtkRange* range, wxScrollBar* win)
     {
         const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
         const int value = win->GetThumbPosition();
-        wxScrollEvent event(eventType, win->GetId(), value, orient);
-        event.SetEventObject(win);
-        win->GetEventHandler()->ProcessEvent(event);
+        const int id = win->GetId();
+
+        // first send the specific event for the user action
+        wxScrollEvent evtSpec(eventType, id, value, orient);
+        evtSpec.SetEventObject(win);
+        win->GetEventHandler()->ProcessEvent(evtSpec);
+
         if (!win->m_isScrolling)
         {
-            wxScrollEvent event(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
-            event.SetEventObject(win);
-            win->GetEventHandler()->ProcessEvent(event);
+            // and if it's over also send a general "changed" event
+            wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
+            evtChanged.SetEventObject(win);
+            win->GetEventHandler()->ProcessEvent(evtChanged);
         }
     }
 }
@@ -73,14 +78,15 @@ gtk_event_after(GtkRange* range, GdkEvent* event, wxScrollBar* win)
 
         const int value = win->GetThumbPosition();
         const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
+        const int id = win->GetId();
 
-        wxScrollEvent event(wxEVT_SCROLL_THUMBRELEASE, win->GetId(), value, orient);
-        event.SetEventObject(win);
-        win->GetEventHandler()->ProcessEvent(event);
+        wxScrollEvent evtRel(wxEVT_SCROLL_THUMBRELEASE, id, value, orient);
+        evtRel.SetEventObject(win);
+        win->GetEventHandler()->ProcessEvent(evtRel);
 
-        wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
-        event2.SetEventObject(win);
-        win->GetEventHandler()->ProcessEvent(event2);
+        wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient);
+        evtChanged.SetEventObject(win);
+        win->GetEventHandler()->ProcessEvent(evtChanged);
     }
 }
 }
index cb6c98f1c57dde76ae6d5545e73c30fb1dd25395..b1409d49f723739bfd9ed03e2d52534ca5f918e3 100644 (file)
@@ -527,8 +527,8 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
 
             // if we have a dropdown menu, we use 2 GTK tools internally
             wxToolBarToolsList::compatibility_iterator node = m_tools.Item( i );
-            wxToolBarTool *tool = (wxToolBarTool*) node->GetData();
-            if ( tool->IsButton() && (tool->GetKind() == wxITEM_DROPDOWN) )
+            wxToolBarTool * const tool2 = (wxToolBarTool*) node->GetData();
+            if ( tool2->IsButton() && tool2->GetKind() == wxITEM_DROPDOWN )
                 posGtk++;
         }
     }
index 9517877940a15cd1fac0c153432e196594425078..8d403c0228b3e9d6fbe3d6eb9d7cc913cfb2e165 100644 (file)
@@ -251,10 +251,10 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text,
         for (size_t i = 0; i < tabs.GetCount(); i++)
             tagname += wxString::Format(_T(" %d"), tabs[i]);
 
-        const wxWX2MBbuf buf = tagname.mb_str(wxConvUTF8);
+        const wxWX2MBbuf buftag = tagname.utf8_str();
 
         tag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table( text_buffer ),
-                                        buf );
+                                        buftag );
         if (!tag)
         {
             // Factor to convert from 1/10th of a mm into pixels
@@ -270,7 +270,7 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text,
             PangoTabArray* tabArray = pango_tab_array_new(tabs.GetCount(), TRUE);
             for (size_t i = 0; i < tabs.GetCount(); i++)
                 pango_tab_array_set_tab(tabArray, i, PANGO_TAB_LEFT, (gint)(tabs[i] * factor));
-            tag = gtk_text_buffer_create_tag( text_buffer, buf,
+            tag = gtk_text_buffer_create_tag( text_buffer, buftag,
                                               "tabs", tabArray, NULL );
             pango_tab_array_free(tabArray);
         }
@@ -951,7 +951,6 @@ wxString wxTextCtrl::GetValue() const
 {
     wxCHECK_MSG( m_text != NULL, wxEmptyString, wxT("invalid text ctrl") );
 
-    wxString tmp;
     if ( IsMultiLine() )
     {
         GtkTextIter start;
@@ -967,8 +966,6 @@ wxString wxTextCtrl::GetValue() const
         const gchar *text = gtk_entry_get_text( GTK_ENTRY(m_text) );
         return wxGTK_CONV_BACK(text);
     }
-
-    return tmp;
 }
 
 wxFontEncoding wxTextCtrl::GetTextEncoding() const
index 7f1927726824df3089f8b30bd7c0836bd22333e4..b7e49281e122b3251b5b181343ec0fbfc6f9eab3 100644 (file)
@@ -2002,9 +2002,10 @@ gtk_scrollbar_event_after(GtkRange* range, GdkEvent* event, wxWindow* win)
 
         const int orient = wxWindow::OrientFromScrollDir(
                                         win->ScrollDirFromRange(range));
-        wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBRELEASE, win->GetScrollPos(orient), orient);
-        event.SetEventObject(win);
-        win->GTKProcessEvent(event);
+        wxScrollWinEvent evt(wxEVT_SCROLLWIN_THUMBRELEASE,
+                                win->GetScrollPos(orient), orient);
+        evt.SetEventObject(win);
+        win->GTKProcessEvent(evt);
     }
 }
 
index 0bca1979a9a7003ee0cde098c62d1bae659f55cf..77748127e09f0a4481f99b6750abfbfacf4d1f75 100644 (file)
@@ -8,8 +8,17 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/app.h"
-#include "wx/log.h"
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/log.h"
+#endif
+
 #include "wx/evtloop.h"
 
 #include <signal.h>