]> git.saurik.com Git - wxWidgets.git/commitdiff
silence warnings about shadowed variables with GCC -Wshadow
authorPaul Cornett <paulcor@bullseye.com>
Thu, 4 Oct 2012 15:55:06 +0000 (15:55 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 4 Oct 2012 15:55:06 +0000 (15:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
include/wx/arrimpl.cpp
src/aui/auibar.cpp
src/aui/auibook.cpp
src/aui/framemanager.cpp
src/common/dynarray.cpp
src/common/file.cpp
src/common/markupparser.cpp
src/common/translation.cpp
src/generic/grid.cpp
src/generic/treectlg.cpp
src/gtk/bmpcbox.cpp
src/gtk/colordlg.cpp
src/gtk/print.cpp
src/gtk/toplevel.cpp
src/propgrid/editors.cpp
src/propgrid/property.cpp
src/ribbon/art_msw.cpp
src/unix/fswatcher_inotify.cpp

index f2bc7ce73f96540eeb39e244210b5ef8512501e6..1ed418dd6a57d342e315deba06e4b58f0aaaa3c4 100644 (file)
@@ -91,13 +91,13 @@ void name::Insert(const T& item, size_t uiIndex, size_t nInsert)              \
     base_array::operator[](uiIndex + i) = new T(item);                        \
 }                                                                             \
                                                                               \
-int name::Index(const T& Item, bool bFromEnd) const                           \
+int name::Index(const T& item, bool bFromEnd) const                           \
 {                                                                             \
   if ( bFromEnd ) {                                                           \
     if ( size() > 0 ) {                                                       \
       size_t ui = size() - 1;                                                 \
       do {                                                                    \
-        if ( (T*)base_array::operator[](ui) == &Item )                        \
+        if ( (T*)base_array::operator[](ui) == &item )                        \
           return static_cast<int>(ui);                                     \
         ui--;                                                                 \
       }                                                                       \
@@ -106,7 +106,7 @@ int name::Index(const T& Item, bool bFromEnd) const                           \
   }                                                                           \
   else {                                                                      \
     for( size_t ui = 0; ui < size(); ui++ ) {                                 \
-      if( (T*)base_array::operator[](ui) == &Item )                           \
+      if( (T*)base_array::operator[](ui) == &item )                           \
         return static_cast<int>(ui);                                       \
     }                                                                         \
   }                                                                           \
index 9cb1b9ab0a77ec7aa2e50b73b6fa45de6bcf556c..b18adb34405325034cf7a7ad5756771eb9418472 100644 (file)
@@ -2530,9 +2530,9 @@ void wxAuiToolBar::OnLeftDown(wxMouseEvent& evt)
                 Refresh(false);
                 if (res != -1)
                 {
-                    wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, res);
-                    e.SetEventObject(this);
-                    GetParent()->GetEventHandler()->ProcessEvent(e);
+                    wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, res);
+                    event.SetEventObject(this);
+                    GetParent()->GetEventHandler()->ProcessEvent(event);
                 }
             }
 
index d4a0f5a9400417321e96bf43c2bafba690636fb8..4a2596f52bcc915576b137cb6b2ec4fbb58fd050 100644 (file)
@@ -1093,11 +1093,11 @@ void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
     {
         m_isDragging = false;
 
-        wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId);
-        evt.SetSelection(GetIdxFromWindow(m_clickTab));
-        evt.SetOldSelection(evt.GetSelection());
-        evt.SetEventObject(this);
-        GetEventHandler()->ProcessEvent(evt);
+        wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId);
+        e.SetSelection(GetIdxFromWindow(m_clickTab));
+        e.SetOldSelection(e.GetSelection());
+        e.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(e);
 
         return;
     }
@@ -1121,11 +1121,11 @@ void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
 
         if (!(m_pressedButton->curState & wxAUI_BUTTON_STATE_DISABLED))
         {
-            wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId);
-            evt.SetSelection(GetIdxFromWindow(m_clickTab));
-            evt.SetInt(m_pressedButton->id);
-            evt.SetEventObject(this);
-            GetEventHandler()->ProcessEvent(evt);
+            wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId);
+            e.SetSelection(GetIdxFromWindow(m_clickTab));
+            e.SetInt(m_pressedButton->id);
+            e.SetEventObject(this);
+            GetEventHandler()->ProcessEvent(e);
         }
 
         m_pressedButton = NULL;
@@ -1254,11 +1254,11 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt)
 
     if (m_isDragging)
     {
-        wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId);
-        evt.SetSelection(GetIdxFromWindow(m_clickTab));
-        evt.SetOldSelection(evt.GetSelection());
-        evt.SetEventObject(this);
-        GetEventHandler()->ProcessEvent(evt);
+        wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId);
+        e.SetSelection(GetIdxFromWindow(m_clickTab));
+        e.SetOldSelection(e.GetSelection());
+        e.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(e);
         return;
     }
 
@@ -1269,11 +1269,11 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt)
     if (abs(pos.x - m_clickPt.x) > drag_x_threshold ||
         abs(pos.y - m_clickPt.y) > drag_y_threshold)
     {
-        wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId);
-        evt.SetSelection(GetIdxFromWindow(m_clickTab));
-        evt.SetOldSelection(evt.GetSelection());
-        evt.SetEventObject(this);
-        GetEventHandler()->ProcessEvent(evt);
+        wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId);
+        e.SetSelection(GetIdxFromWindow(m_clickTab));
+        e.SetOldSelection(e.GetSelection());
+        e.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(e);
 
         m_isDragging = true;
     }
index 30ca612af45f534d5492842c92e6afff533e10ca..696a1f2a7b1b76ce886561a44e5e41bf09c56625 100644 (file)
@@ -3236,16 +3236,16 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
         // determine the mouse offset and the pane size, both in the
         // direction of the dock itself, and perpendicular to the dock
 
-        int offset, size;
+        int mouseOffset, size;
 
         if (part->orientation == wxVERTICAL)
         {
-            offset = pt.y - part->rect.y;
+            mouseOffset = pt.y - part->rect.y;
             size = part->rect.GetHeight();
         }
         else
         {
-            offset = pt.x - part->rect.x;
+            mouseOffset = pt.x - part->rect.x;
             size = part->rect.GetWidth();
         }
 
@@ -3253,7 +3253,7 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
 
         // if we are in the top/left part of the pane,
         // insert the pane before the pane being hovered over
-        if (offset <= size/2)
+        if (mouseOffset <= size/2)
         {
             drop_position = part->pane->dock_pos;
             DoInsertPane(panes,
@@ -3265,7 +3265,7 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
 
         // if we are in the bottom/right part of the pane,
         // insert the pane before the pane being hovered over
-        if (offset > size/2)
+        if (mouseOffset > size/2)
         {
             drop_position = part->pane->dock_pos+1;
             DoInsertPane(panes,
@@ -3367,15 +3367,15 @@ void wxAuiManager::ShowHint(const wxRect& rect)
                     pane.frame &&
                         pane.frame->IsShown())
             {
-                wxRect rect = pane.frame->GetRect();
+                wxRect r = pane.frame->GetRect();
 #ifdef __WXGTK__
                 // wxGTK returns the client size, not the whole frame size
-                rect.width += 15;
-                rect.height += 35;
-                rect.Inflate(5);
+                r.width += 15;
+                r.height += 35;
+                r.Inflate(5);
 #endif
 
-                clip.Subtract(rect);
+                clip.Subtract(r);
             }
         }
 
@@ -4658,8 +4658,8 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
 
         pane.SetFlag(wxAuiPaneInfo::actionPane, true);
 
-        wxPoint pt = event.GetPosition();
-        DoDrop(m_docks, m_panes, pane, pt, m_actionOffset);
+        wxPoint point = event.GetPosition();
+        DoDrop(m_docks, m_panes, pane, point, m_actionOffset);
 
         // if DoDrop() decided to float the pane, set up
         // the floating pane's initial position
index 8d62ca6b06101e411e656886e72367ee9759fb16..0f556decb500d14f799701da81c8edf15cd82032 100644 (file)
@@ -158,13 +158,13 @@ void name::Grow(size_t nIncrement)                                          \
   if( (m_nCount == m_nSize) || ((m_nSize - m_nCount) < nIncrement) ) {      \
     if( m_nSize == 0 ) {                                                    \
       /* was empty, determine initial size */                               \
-      size_t size = WX_ARRAY_DEFAULT_INITIAL_SIZE;                          \
-      if (size < nIncrement) size = nIncrement;                             \
+      size_t sz = WX_ARRAY_DEFAULT_INITIAL_SIZE;                            \
+      if (sz < nIncrement) sz = nIncrement;                                 \
       /* allocate some memory */                                            \
-      m_pItems = new T[size];                                               \
+      m_pItems = new T[sz];                                                 \
       /* only grow if allocation succeeded */                               \
       if ( m_pItems ) {                                                     \
-          m_nSize = size;                                                   \
+          m_nSize = sz;                                                     \
       }                                                                     \
     }                                                                       \
     else                                                                    \
index 02a15cb2ca492cdc1eea6882b070c05db644d315..b2cd1bed5f6a0ff54889792d1773bd8c6bf97f47 100644 (file)
@@ -204,17 +204,17 @@ bool wxFile::Create(const wxString& fileName, bool bOverwrite, int accessMode)
 {
     // if bOverwrite we create a new file or truncate the existing one,
     // otherwise we only create the new file and fail if it already exists
-    int fd = wxOpen( fileName,
+    int fildes = wxOpen( fileName,
                      O_BINARY | O_WRONLY | O_CREAT |
                      (bOverwrite ? O_TRUNC : O_EXCL),
                      accessMode );
-    if ( CheckForError(fd) )
+    if ( CheckForError(fildes) )
     {
         wxLogSysError(_("can't create file '%s'"), fileName);
         return false;
     }
 
-    Attach(fd);
+    Attach(fildes);
     return true;
 }
 
@@ -258,15 +258,15 @@ bool wxFile::Open(const wxString& fileName, OpenMode mode, int accessMode)
     accessMode &= wxS_IRUSR | wxS_IWUSR;
 #endif // __WINDOWS__
 
-    int fd = wxOpen( fileName, flags, accessMode);
+    int fildes = wxOpen( fileName, flags, accessMode);
 
-    if ( CheckForError(fd) )
+    if ( CheckForError(fildes) )
     {
         wxLogSysError(_("can't open file '%s'"), fileName);
         return false;
     }
 
-    Attach(fd);
+    Attach(fildes);
     return true;
 }
 
@@ -304,11 +304,11 @@ bool wxFile::ReadAll(wxString *str, const wxMBConv& conv)
     {
         static const unsigned READSIZE = 4096;
 
-        ssize_t read = Read(p, length > READSIZE ? READSIZE : length);
-        if ( read == wxInvalidOffset )
+        ssize_t nread = Read(p, length > READSIZE ? READSIZE : length);
+        if ( nread == wxInvalidOffset )
             return false;
 
-        p += read;
+        p += nread;
     }
 
     *p = 0;
index c0580e242fe770185d0abb4e3480cc4a4e37a12f..70b680bd7f9a2a6d9d688f50d91d81b6336aa558 100644 (file)
@@ -172,7 +172,6 @@ wxMarkupParser::ParseAttrs(wxString attrs, TagAndAttrs& tagAndAttrs)
             else // Must be a CSS-like size specification
             {
                 int cssSize = 1;
-                wxString rest;
                 if ( value.StartsWith("xx-", &rest) )
                     cssSize = 3;
                 else if ( value.StartsWith("x-", &rest) )
index d5022c9ac6250d52367aacbcee5c3138ee71bad5..1996330eac5d7eecfff058fc16f8d2e6fd965c6c 100644 (file)
@@ -289,7 +289,7 @@ public:
         T_LEFT_BRACKET, T_RIGHT_BRACKET
     };
     Type type() const { return m_type; }
-    void setType(Type type) { m_type = type; }
+    void setType(Type t) { m_type = t; }
     // for T_NUMBER only
     typedef int Number;
     Number number() const { return m_number; }
@@ -466,7 +466,7 @@ private:
 class wxPluralFormsNode
 {
 public:
-    wxPluralFormsNode(const wxPluralFormsToken& token) : m_token(token) {}
+    wxPluralFormsNode(const wxPluralFormsToken& t) : m_token(t) {}
     const wxPluralFormsToken& token() const { return m_token; }
     const wxPluralFormsNode* node(unsigned i) const
         { return m_nodes[i].get(); }
index 375fc63b754c37f3ed984d24871799d21f8d3d32..6d6649d96ea2b892061f4391f77cf5ca06720a1b 100644 (file)
@@ -2877,7 +2877,6 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
             if ( !m_colAt.IsEmpty() )
             {
                 //Shift the column IDs
-                int i;
                 for ( i = 0; i < m_numCols - numCols; i++ )
                 {
                     if ( m_colAt[i] >= (int)pos )
@@ -2947,7 +2946,6 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
                 m_colAt.Add( 0, numCols );
 
                 //Set the new columns' positions
-                int i;
                 for ( i = oldNumCols; i < m_numCols; i++ )
                 {
                     m_colAt[i] = i;
@@ -3531,9 +3529,8 @@ void wxGrid::DoUpdateResizeColWidth(int w)
 
 void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
 {
-    int x, y;
-    wxPoint pos( event.GetPosition() );
-    CalcUnscrolledPosition( pos.x, pos.y, &x, &y );
+    int x;
+    CalcUnscrolledPosition( event.GetPosition().x, 0, &x, NULL );
 
     int col = XToCol(x);
     if ( event.Dragging() )
@@ -3649,14 +3646,13 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
     //
     else if ( event.LeftDown() )
     {
-        int col = XToEdgeOfCol(x);
-        if ( col != wxNOT_FOUND && CanDragColSize(col) )
+        int colEdge = XToEdgeOfCol(x);
+        if ( colEdge != wxNOT_FOUND && CanDragColSize(colEdge) )
         {
             ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, GetColLabelWindow());
         }
         else // not a request to start resizing
         {
-            col = XToCol(x);
             if ( col >= 0 &&
                  !SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, -1, col, event ) )
             {
@@ -4415,14 +4411,14 @@ bool wxGrid::DoEndDragResizeLine(const wxGridOperations& oper)
             oper.SelectSize(rect) = oper.Select(size);
 
             int subtractLines = 0;
-            const int lineStart = doper.PosToLine(this, posLineStart);
-            if ( lineStart >= 0 )
+            int line = doper.PosToLine(this, posLineStart);
+            if ( line >= 0 )
             {
                 // ensure that if we have a multi-cell block we redraw all of
                 // it by increasing the refresh area to cover it entirely if a
                 // part of it is affected
                 const int lineEnd = doper.PosToLine(this, posLineEnd, true);
-                for ( int line = lineStart; line < lineEnd; line++ )
+                for ( ; line < lineEnd; line++ )
                 {
                     int cellLines = oper.Select(
                         GetCellSize(oper.MakeCoords(m_dragRowOrCol, line)));
index 0eaabbf6dea97ffaa23bdb393c56ae9e925528ca..33b3eaeca33b91a15ec3936b56e4f48afff6f5b0 100644 (file)
@@ -423,8 +423,8 @@ BEGIN_EVENT_TABLE(wxTreeTextCtrl,wxTextCtrl)
 END_EVENT_TABLE()
 
 wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner,
-                               wxGenericTreeItem *item)
-              : m_itemEdited(item), m_startValue(item->GetText())
+                               wxGenericTreeItem *itm)
+              : m_itemEdited(itm), m_startValue(itm->GetText())
 {
     m_owner = owner;
     m_aboutToFinish = false;
index 672413d7986ea5165a61f240dac13e0e0731461a..f9f8f042fba914751247596cf89b0bd5a3e6e2ee 100644 (file)
@@ -102,9 +102,9 @@ bool wxBitmapComboBox::Create(wxWindow *parent,
     // Select 'value' in entry-less mode
     if ( !GetEntry() )
     {
-        int n = FindString(value);
-        if ( n != wxNOT_FOUND )
-            SetSelection(n);
+        int i = FindString(value);
+        if (i != wxNOT_FOUND)
+            SetSelection(i);
     }
 
     return true;
index ed38b7d9332b870e8bf6f2acfdf9a41c994632c5..c6ac162f2fc934bdb89a946012b6851a7e8ef4ee 100644 (file)
@@ -131,13 +131,13 @@ void wxColourDialog::ColourDataToDialog()
         gtk_color_selection_dialog_get_color_selection(
         GTK_COLOR_SELECTION_DIALOG(m_widget)));
 
-    const wxColour& c = m_data.GetColour();
-    if (c.IsOk())
+    const wxColour& color = m_data.GetColour();
+    if (color.IsOk())
     {
 #ifdef __WXGTK3__
-        gtk_color_selection_set_current_rgba(sel, c);
+        gtk_color_selection_set_current_rgba(sel, color);
 #else
-        gtk_color_selection_set_current_color(sel, c.GetColor());
+        gtk_color_selection_set_current_color(sel, color.GetColor());
 #endif
     }
 
index 7ef941c86264676ed84612c0fedbaf21c6ee3de2..34143e4b73391b50f53ad584569550fc6b787f84 100644 (file)
@@ -1501,9 +1501,9 @@ void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
     int i;
     for (i = 1; i < n; i++)
     {
-        int x = points[i].x + xoffset;
-        int y = points[i].y + yoffset;
-        cairo_line_to( m_cairo, XLOG2DEV(x), YLOG2DEV(y) );
+        int xx = points[i].x + xoffset;
+        int yy = points[i].y + yoffset;
+        cairo_line_to( m_cairo, XLOG2DEV(xx), YLOG2DEV(yy) );
     }
     cairo_close_path(m_cairo);
 
index 1bcc3ce8e94f80b39cde3679237efbbc634a6ef3..b561d5f61d7cf094e6b5891598f2893cbb36ecd1 100644 (file)
@@ -377,9 +377,9 @@ gtk_frame_window_state_callback( GtkWidget* WXUNUSED(widget),
     // if maximized bit changed and it is now set
     if (event->changed_mask & event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED)
     {
-        wxMaximizeEvent event(win->GetId());
-        event.SetEventObject(win);
-        win->HandleWindowEvent(event);
+        wxMaximizeEvent evt(win->GetId());
+        evt.SetEventObject(win);
+        win->HandleWindowEvent(evt);
     }
 
     return false;
index 1c2b9b60396ac5975a0a9d9def80f079cc0093a0..fe58ba0ef79806aaef3b4d03c809add193b0b0b1 100644 (file)
@@ -882,7 +882,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
             if ( comValIndex >= 0 )
             {
                 const wxPGCommonValue* cv = GetCommonValue(comValIndex);
-                wxPGCellRenderer* renderer = cv->GetRenderer();
+                renderer = cv->GetRenderer();
                 r.width = rect.width;
                 renderer->Render( dc, r, this, p, m_selColumn, comValIndex, renderFlags );
                 return;
@@ -1619,8 +1619,8 @@ wxPGWindowList wxPGCheckBoxEditor::CreateControls( wxPropertyGrid* propGrid,
         // If mouse cursor was on the item, toggle the value now.
         if ( propGrid->GetInternalFlags() & wxPG_FL_ACTIVATION_BY_CLICK )
         {
-            wxPoint pt = cb->ScreenToClient(::wxGetMousePosition());
-            if ( pt.x <= (wxPG_XBEFORETEXT-2+cb->m_boxHeight) )
+            wxPoint point = cb->ScreenToClient(::wxGetMousePosition());
+            if ( point.x <= (wxPG_XBEFORETEXT-2+cb->m_boxHeight) )
             {
                 if ( cb->m_state & wxSCB_STATE_CHECKED )
                     cb->m_state &= ~wxSCB_STATE_CHECKED;
index 5fc00a35b56a63a9bb5a0cea43f0db520726660b..ceaba28ae3f92e6da1d96a0d400e365d94c192be 100644 (file)
@@ -1035,7 +1035,7 @@ bool wxPGProperty::IntToValue( wxVariant& variant, int number, int WXUNUSED(argF
 }
 
 // Convert semicolon delimited tokens into child values.
-bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int argFlags ) const
+bool wxPGProperty::StringToValue( wxVariant& v, const wxString& text, int argFlags ) const
 {
     if ( !GetChildCount() )
         return false;
@@ -1240,7 +1240,7 @@ bool wxPGProperty::StringToValue( wxVariant& variant, const wxString& text, int
     }
 
     if ( changed )
-        variant = list;
+        v = list;
 
     return changed;
 }
index 8bd4273eeb10097913d23e75457a6e23e921d208..ca4b457e231ad6bd33ae478c99c0849c0f09d969 100644 (file)
@@ -1428,7 +1428,7 @@ void wxRibbonMSWArtProvider::ReallyDrawTabSeparator(wxWindow* wnd, const wxRect&
 }
 
 void wxRibbonMSWArtProvider::DrawPartialPageBackground(wxDC& dc,
-        wxWindow* wnd, const wxRect& rect, wxRibbonPage* page,
+        wxWindow* wnd, const wxRect& r, wxRibbonPage* page,
         wxPoint offset, bool hovered)
 {
     wxRect background;
@@ -1465,7 +1465,7 @@ void wxRibbonMSWArtProvider::DrawPartialPageBackground(wxDC& dc,
     lower_rect.y += upper_rect.height;
     lower_rect.height -= upper_rect.height;
 
-    wxRect paint_rect(rect);
+    wxRect paint_rect(r);
     paint_rect.x += offset.x;
     paint_rect.y += offset.y;
 
index 675d1168e352aa797859ab5af590f706b69fdbd2..3b40d6aa2e48f4ad78c7c4969ec64b2c76b97c6e 100644 (file)
@@ -268,8 +268,8 @@ protected:
         // renames
         else if (nativeFlags & IN_MOVE)
         {
-            wxInotifyCookies::iterator it = m_cookies.find(inevt.cookie);
-            if ( it == m_cookies.end() )
+            wxInotifyCookies::iterator it2 = m_cookies.find(inevt.cookie);
+            if ( it2 == m_cookies.end() )
             {
                 int size = sizeof(inevt) + inevt.len;
                 inotify_event* e = (inotify_event*) operator new (size);
@@ -280,7 +280,7 @@ protected:
             }
             else
             {
-                inotify_event& oldinevt = *(it->second);
+                inotify_event& oldinevt = *(it2->second);
 
                 wxFileSystemWatcherEvent event(flags);
                 if ( inevt.mask & IN_MOVED_FROM )
@@ -295,7 +295,7 @@ protected:
                 }
                 SendEvent(event);
 
-                m_cookies.erase(it);
+                m_cookies.erase(it2);
                 delete &oldinevt;
             }
         }