From: Włodzimierz Skiba Date: Fri, 16 Jul 2004 13:19:32 +0000 (+0000) Subject: Fixes to warnings about assigning unused values. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5cb598ae2014330aaecbd19b8bbe41df2ad61911 Fixes to warnings about assigning unused values. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 247a300e6d..d9448c9035 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -1008,7 +1008,6 @@ bool wxICOHandler::SaveFile(wxImage *image, bool verbose) { - bool bResult = FALSE; //sanity check; icon must be less than 127 pixels high and 255 wide if ( image->GetHeight () > 127 ) { @@ -1100,7 +1099,7 @@ bool wxICOHandler::SaveFile(wxImage *image, //calculate size and offset of image and mask wxCountingOutputStream cStream; - bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask); + bool bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask); if ( !bResult ) { if ( verbose ) @@ -1206,8 +1205,8 @@ bool wxICOHandler::LoadFile(wxImage *image, wxInputStream& stream, bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream, bool WXUNUSED(verbose), int index) { - bool bResult = FALSE; - bool IsBmp = FALSE; + bool bResult wxDUMMY_INITIALIZE(false); + bool IsBmp = false; ICONDIR IconDir; @@ -1253,7 +1252,7 @@ bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream, if ( iSel == wxNOT_FOUND || iSel < 0 || iSel >= nIcons ) { wxLogError(_("ICO: Invalid icon index.")); - bResult = FALSE; + bResult = false; } else { diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index 92036a89af..b7bbd4fb77 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -152,10 +152,9 @@ int wxColourDialog::ShowModal() bool success = ::ChooseColor(&(chooseColorStruct)) != 0; // Try to highlight the correct window (the parent) - HWND hWndParent = 0; if (GetParent()) { - hWndParent = (HWND) GetParent()->GetHWND(); + HWND hWndParent = (HWND) GetParent()->GetHWND(); if (hWndParent) ::BringWindowToTop(hWndParent); } diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 668756f630..1bf861d06a 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -250,7 +250,7 @@ bool wxControl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result) { - wxEventType eventType = wxEVT_NULL; + wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL); NMHDR *hdr = (NMHDR*) lParam; switch ( hdr->code ) diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 0789752ef0..2941c5cc4b 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -120,10 +120,10 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor) ImageList_Destroy(GetHimageList()); m_hImageList = 0; - UINT flags = 0 ; #ifdef __WXWINCE__ - flags = ILC_COLOR; + UNIT flags = ILC_COLOR; #else + UINT flags wxDUMMY_INITIALIZE(0) ; if (image.GetDepth() <= 4) flags = ILC_COLOR4; else if (image.GetDepth() <= 8) @@ -177,10 +177,10 @@ bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor) ImageList_Destroy(GetHimageList()); m_hImageList = 0; - UINT flags = 0 ; #ifdef __WXWINCE__ - flags = ILC_COLOR; + UINT flags = ILC_COLOR; #else + UINT flags wxDUMMY_INITIALIZE(0) ; if (image.GetDepth() <= 4) flags = ILC_COLOR4; else if (image.GetDepth() <= 8) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index e8890f42f2..efc6a5c630 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -284,7 +284,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, wxWindowID id, const wxString& name) { - wxStatusBar *statusBar = NULL; + wxStatusBar *statusBar wxDUMMY_INITIALIZE(NULL); #if wxUSE_NATIVE_STATUSBAR if ( !UsesNativeStatusBar() ) @@ -616,8 +616,8 @@ void wxFrame::PositionToolBar() // Optimise such that we don't have to always resize the toolbar // when the frame changes, otherwise we'll get a lot of flicker. - bool heightChanging = TRUE; - bool widthChanging = TRUE; + bool heightChanging wxDUMMY_INITIALIZE(true); + bool widthChanging wxDUMMY_INITIALIZE(true); if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) { diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index dd37daa076..dfbc42e004 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -463,10 +463,9 @@ void wxListCtrl::FreeAllInternalData() if (m_AnyInternalData) { int n = GetItemCount(); - int i = 0; m_ignoreChangeMessages = TRUE; - for (i = 0; i < n; i++) + for (int i = 0; i < n; i++) wxDeleteInternalData(this, i); m_ignoreChangeMessages = FALSE; @@ -2313,7 +2312,6 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) wxSize clientSize = GetClientSize(); wxRect itemRect; - int cy=0; int itemCount = GetItemCount(); int i; @@ -2324,7 +2322,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) { if (GetItemRect(i, itemRect)) { - cy = itemRect.GetTop(); + int cy = itemRect.GetTop(); if (i != 0) // Don't draw the first one { dc.DrawLine(0, cy, clientSize.x, cy); diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index bc72876edd..80e1d2d484 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -115,7 +115,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt m_printDialogData.SetMaxPage(9999); // Create a suitable device context - wxDC *dc = NULL; + wxDC *dc wxDUMMY_INITIALIZE(NULL); if (prompt) { dc = PrintDialog(parent); @@ -134,18 +134,13 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt return false; } - int logPPIScreenX = 0; - int logPPIScreenY = 0; - int logPPIPrinterX = 0; - int logPPIPrinterY = 0; - HDC hdc = ::GetDC(NULL); - logPPIScreenX = ::GetDeviceCaps(hdc, LOGPIXELSX); - logPPIScreenY = ::GetDeviceCaps(hdc, LOGPIXELSY); + int logPPIScreenX = ::GetDeviceCaps(hdc, LOGPIXELSX); + int logPPIScreenY = ::GetDeviceCaps(hdc, LOGPIXELSY); ::ReleaseDC(NULL, hdc); - logPPIPrinterX = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSX); - logPPIPrinterY = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSY); + int logPPIPrinterX = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSX); + int logPPIPrinterY = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSY); if (logPPIPrinterX == 0 || logPPIPrinterY == 0) { delete dc; @@ -373,7 +368,7 @@ void wxWindowsPrintPreview::DetermineScaling() wxPrinterDC printerDC(m_printDialogData.GetPrintData()); int printerWidth = 150; - int printerHeight = 250; + int printerHeight wxDUMMY_INITIALIZE(250); int printerXRes = 1500; int printerYRes = 2500; diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 4b8f7161b9..73c40bd139 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -1035,7 +1035,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") ); - bool processed = TRUE; + bool processed wxDUMMY_INITIALIZE(true); // HELPINFO doesn't seem to be supported on WinCE. #ifndef __WXWINCE__ @@ -1071,7 +1071,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, processed = radiobox->GetEventHandler()->ProcessEvent(helpEvent); } else - processed = FALSE; + processed = false; #endif if (processed) return 0; diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 7f7b7c2c7e..4f1b342899 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -173,6 +173,8 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, int position, maxPos, trackPos = pos; + wxUnusedVar(trackPos); + // when we're dragging the scrollbar we can't use pos parameter because it // is limited to 16 bits // JACS: now always using GetScrollInfo, since there's no reason diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index 4903872857..9cbb71978c 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -168,7 +168,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, minLabel.Printf(wxT("%d"), minValue); wstyle = STATIC_FLAGS; if ( m_windowStyle & wxCLIP_SIBLINGS ) - msStyle |= WS_CLIPSIBLINGS; + wstyle |= WS_CLIPSIBLINGS; m_staticMin = (WXHWND) CreateWindowEx ( 0, wxT("STATIC"), minLabel, @@ -237,7 +237,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, wstyle = STATIC_FLAGS; if ( m_windowStyle & wxCLIP_SIBLINGS ) - msStyle |= WS_CLIPSIBLINGS; + wstyle |= WS_CLIPSIBLINGS; m_staticMax = (WXHWND) CreateWindowEx ( diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 86fda57454..c667893ba0 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -151,10 +151,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, // we may have either bitmap or icon: if a bitmap with mask is passed, we // will transform it to an icon ourselves because otherwise the mask will // be ignored by Windows - wxGDIImage *image = (wxGDIImage *)NULL; m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon)); - image = ConvertImage( bitmap ); + wxGDIImage *image = ConvertImage( bitmap ); m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); // create the native control diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index acbfd871c4..4beff0f31d 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -129,7 +129,7 @@ wxTabCtrl::~wxTabCtrl() bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { wxTabEvent event(wxEVT_NULL, m_windowId); - wxEventType eventType = wxEVT_NULL; + wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL); NMHDR* hdr1 = (NMHDR*) lParam; switch ( hdr1->code ) { diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ebf5c7d67a..fe05e3cbec 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1746,9 +1746,10 @@ bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y) point.y = y; ::ClientToScreen(hWnd, &point); wxCurrentPopupMenu = menu; +#if defined(__WXWINCE__) UINT flags = 0; -#if !defined(__WXWINCE__) - flags = TPM_RIGHTBUTTON; +#else + UINT flags = TPM_RIGHTBUTTON; #endif ::TrackPopupMenu(hMenu, flags, point.x, point.y, 0, hWnd, NULL);