]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes to warnings about assigning unused values.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 16 Jul 2004 13:19:32 +0000 (13:19 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 16 Jul 2004 13:19:32 +0000 (13:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
src/common/imagbmp.cpp
src/msw/colordlg.cpp
src/msw/control.cpp
src/msw/dragimag.cpp
src/msw/frame.cpp
src/msw/listctrl.cpp
src/msw/printwin.cpp
src/msw/radiobox.cpp
src/msw/scrolbar.cpp
src/msw/slider95.cpp
src/msw/statbmp.cpp
src/msw/tabctrl.cpp
src/msw/window.cpp

index 247a300e6deb91e9aa31add878811fde09f61aaa..d9448c903553854939dc56230d7a99bdd86f21f4 100644 (file)
@@ -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
     {
index 92036a89af7cf8b02da34be55c389e07c7cc984e..b7bbd4fb773722977fb9a59face6a7461bd8f42c 100644 (file)
@@ -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);
     }
index 668756f630479d82084c8dd226ce70097ba0560d..1bf861d06a74520aac734938a9112a976c68076e 100644 (file)
@@ -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 )
index 0789752ef0613378373fcdb9bcaaa6897cfe7dd2..2941c5cc4bf47bf1971300543e528e5c1ea8ef18 100644 (file)
@@ -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)
index e8890f42f2e7e629b5abac75da4f95a465f0f48f..efc6a5c6305a3f3fe41b42aa0f95e6a108fa0d7b 100644 (file)
@@ -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 )
         {
index dd37daa07690dad1136906558e17998b2860eda3..dfbc42e004a8ed8347c0696062cf7e32517526ac 100644 (file)
@@ -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);
index bc72876edd8346ad9451ff179cee4749263d33db..80e1d2d484a5869db25da2e688e11c1d17ac1229 100644 (file)
@@ -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;
 
index 4b8f7161b9b043cd672cbbe28d6749b09637a284..73c40bd139797de58ba32506ef94287dd45a493a 100644 (file)
@@ -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;
index 7f7b7c2c7e0c2a60f0c95c93cfe800fd0d0f2cbe..4f1b342899472828a761f5f5dc4b7207b2af1cf0 100644 (file)
@@ -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
index 49038728576b4b2b0412c30a6bca8e1ff122cfdb..9cbb71978c1250e576aab20cbd3b35f086f298b9 100644 (file)
@@ -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
             (
index 86fda57454ec9392b4ca1e02c1d213757942cdaf..c667893ba02de7ffe572a38ddd9025b1d68a8c52 100644 (file)
@@ -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
index acbfd871c497441f253c5f064ca0697cbed87351..4beff0f31d4ff0f1af9e6bcfa28c01f9f546b989 100644 (file)
@@ -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 )
     {
index ebf5c7d67ab4b74eab9155b6f06b53065b0cd243..fe05e3cbecf518ad8776e130cb9f3a8edb58f02a 100644 (file)
@@ -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);