From ecdc7c3442ed560fec0be2c1608820b7aba92d9b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Oct 2015 17:05:37 +0200 Subject: [PATCH] Fix harmless warning about unused variable in wxMSW wxMenu A variable was unused in wxDEBUG_LEVEL==0 build and assigning to it resulted in a warning. Fix this by not defining this variable at all, which also makes the check more clear. --- src/msw/menu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 86dd6df83c..b963165ce9 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -738,10 +738,12 @@ wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) // Update indices of radio groups. if ( m_radioData ) { - bool inExistingGroup = m_radioData->UpdateOnRemoveItem(pos); - - wxASSERT_MSG( !inExistingGroup || item->GetKind() == wxITEM_RADIO, - wxT("Removing non radio button from radio group?") ); + if ( m_radioData->UpdateOnRemoveItem(pos) ) + { + wxASSERT_MSG( item->GetKind() == wxITEM_RADIO, + wxT("Removing non radio button from radio group?") ); + } + //else: item being removed is not in a radio group } // remove the item from the menu