]> git.saurik.com Git - wxWidgets.git/commitdiff
Helpers in disabling warnings for unused params.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 1 Jul 2005 13:39:03 +0000 (13:39 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 1 Jul 2005 13:39:03 +0000 (13:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/winundef.h
include/wx/msw/wrapcctl.h
src/generic/dirctrlg.cpp
src/msw/dc.cpp
src/msw/gdiimage.cpp
src/msw/ole/dataobj.cpp
src/msw/registry.cpp
src/msw/thread.cpp
src/msw/window.cpp

index 3d8a52e0200b40742fa86c3c53d3e834e3e11291..969366cc080d8fed5494360b8e36a3ac189406e9 100644 (file)
 
 #ifdef IsMaximized
     #undef IsMaximized
-    inline BOOL IsMaximized(HWND hwnd)
+    inline BOOL IsMaximized(HWND WXUNUSED_IN_WINCE(hwnd))
     {
 #ifdef __WXWINCE__
-        wxUnusedVar(hwnd);
         return FALSE;
 #else
         return IsZoomed(hwnd);
 
 #ifdef GetFirstChild
     #undef GetFirstChild
-    inline HWND GetFirstChild(HWND hwnd)
+    inline HWND GetFirstChild(HWND WXUNUSED_IN_WINCE(hwnd))
     {
 #ifdef __WXWINCE__
-        wxUnusedVar(hwnd);
         return 0;
 #else
         return GetTopWindow(hwnd);
index 3faa98079015d8da87753c3052263575cd05987f..f61d2cec209f1fdc9ea8862bf34a07fab4787972 100644 (file)
 #include "wx/msw/missing.h"
 
 // Set Unicode format for a common control
-inline void wxSetCCUnicodeFormat(HWND hwnd)
+inline void wxSetCCUnicodeFormat(HWND WXUNUSED_IN_WINCE(hwnd))
 {
 #ifndef __WXWINCE__
     ::SendMessage(hwnd, CCM_SETUNICODEFORMAT, wxUSE_UNICODE, 0);
 #else // !__WXWINCE__
     // here it should be already in Unicode anyhow
-    wxUnusedVar(hwnd);
 #endif // __WXWINCE__/!__WXWINCE__
 }
 
index e66dbb5a0cad194ed8bfbc276d901639786ca275..7c88c16a7cd5fb2bd94154788ef714a3f3379095 100644 (file)
@@ -278,10 +278,9 @@ bool wxIsDriveAvailable(const wxString& dirName)
 
 #elif defined(__WINDOWS__) || defined(__OS2__)
 
-int setdrive(int drive)
+int setdrive(int WXUNUSED_IN_WINCE(drive))
 {
 #ifdef __WXWINCE__
-    wxUnusedVar(drive);
     return 0;
 #elif defined(__GNUWIN32__) && \
     (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
@@ -311,10 +310,9 @@ int setdrive(int drive)
 #endif // !GNUWIN32
 }
 
-bool wxIsDriveAvailable(const wxString& dirName)
+bool wxIsDriveAvailable(const wxString& WXUNUSED_IN_WINCE(dirName))
 {
 #ifdef __WXWINCE__
-    wxUnusedVar(dirName);
     return false;
 #else
 #ifdef __WIN32__
index 63f940e5a9509ebe86f59d486a1268dccc410342..f843360fcf5c3e630954d0b9ab5a02680a7203c4 100644 (file)
@@ -170,15 +170,14 @@ private:
 class StretchBltModeChanger
 {
 public:
-    StretchBltModeChanger(HDC hdc, int mode)
+    StretchBltModeChanger(HDC hdc,
+                          int WXUNUSED_IN_WINCE(mode))
         : m_hdc(hdc)
     {
 #ifndef __WXWINCE__
         m_modeOld = ::SetStretchBltMode(m_hdc, mode);
         if ( !m_modeOld )
             wxLogLastError(_T("SetStretchBltMode"));
-#else
-        wxUnusedVar(mode);
 #endif
     }
 
@@ -560,16 +559,14 @@ void wxDC::Clear()
 #endif
 }
 
-bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
+bool wxDC::DoFloodFill(wxCoord WXUNUSED_IN_WINCE(x),
+                       wxCoord WXUNUSED_IN_WINCE(y),
+                       const wxColour& WXUNUSED_IN_WINCE(col),
+                       int WXUNUSED_IN_WINCE(style))
 {
 #ifdef __WXWINCE__
-    wxUnusedVar(x);
-    wxUnusedVar(y);
-    wxUnusedVar(col);
-    wxUnusedVar(style);
     return false;
 #else
-
     WXMICROWIN_CHECK_HDC_RET(false)
 
     bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
@@ -758,7 +755,11 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
     CalcBoundingBox(x, y);
 }
 
-void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
+void wxDC::DoDrawPolygon(int n,
+                         wxPoint points[],
+                         wxCoord xoffset,
+                         wxCoord yoffset,
+                         int WXUNUSED_IN_WINCE(fillStyle))
 {
     WXMICROWIN_CHECK_HDC
 
@@ -778,8 +779,6 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffs
         }
 #ifndef __WXWINCE__
         int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
-#else
-        wxUnusedVar(fillStyle);
 #endif
         (void)Polygon(GetHdc(), cpoints, n);
 #ifndef __WXWINCE__
@@ -1780,7 +1779,8 @@ void wxDC::SetUserScale(double x, double y)
     this->SetMapMode(m_mappingMode);
 }
 
-void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
+void wxDC::SetAxisOrientation(bool WXUNUSED_IN_WINCE(xLeftRight),
+                              bool WXUNUSED_IN_WINCE(yBottomUp))
 {
     WXMICROWIN_CHECK_HDC
 
@@ -1795,9 +1795,6 @@ void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
 
         SetMapMode(m_mappingMode);
     }
-#else
-    wxUnusedVar(xLeftRight);
-    wxUnusedVar(yBottomUp);
 #endif
 }
 
@@ -2494,7 +2491,7 @@ wxAlphaBlend(HDC hdcDst, int xDst, int yDst, int w, int h, int srcX, int srcY, c
     {
         wxAlphaPixelData::Iterator pDstRowStart = pDst,
                                    pSrcRowStart = pSrc;
-                                   
+
         for ( int x = 0; x < w; x++ )
         {
             // note that source bitmap uses premultiplied alpha (as required by
index f2e84134d0765c6496c2d0d934a720810379e4c4..4f73c774b15194ab6ca86322a98287ca70ebb47f 100644 (file)
@@ -570,7 +570,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
 // private functions
 // ----------------------------------------------------------------------------
 
-wxSize wxGetHiconSize(HICON hicon)
+wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon))
 {
     // default icon size on this hardware
     // usually 32x32 but can be other (smaller) on pocket devices
@@ -601,9 +601,8 @@ wxSize wxGetHiconSize(HICON hicon)
                 ::DeleteObject(info.hbmColor);
         }
     }
-#else
-    wxUnusedVar(hicon);
 #endif
+
     return size;
 }
 
index e26a1ea1d5c7ab54020f1820b64a3f4df2aba616..73924fa3e2e2b01f3a3c453dd97b931ba0fc6f03 100644 (file)
@@ -979,7 +979,8 @@ bool wxBitmapDataObject::SetData(const wxDataFormat& format,
 // wxFileDataObject
 // ----------------------------------------------------------------------------
 
-bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *pData)
+bool wxFileDataObject::SetData(size_t WXUNUSED(size),
+                               const void *WXUNUSED_IN_WINCE(pData))
 {
 #ifndef __WXWINCE__
     m_filenames.Empty();
@@ -1015,7 +1016,6 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *pData)
 
     return true;
 #else
-    wxUnusedVar(pData);
     return false;
 #endif
 }
@@ -1055,7 +1055,7 @@ size_t wxFileDataObject::GetDataSize() const
 #endif
 }
 
-bool wxFileDataObject::GetDataHere(void *pData) const
+bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const
 {
 #ifndef __WXWINCE__
     // pData points to an externally allocated memory block
@@ -1095,7 +1095,6 @@ bool wxFileDataObject::GetDataHere(void *pData) const
 
     return true;
 #else
-    wxUnusedVar(pData);
     return false;
 #endif
 }
index 7020b4c030aa36e72ced499751b6c3225c0fe2e2..a266cc3ad969b6dd4c1de57e76b537da9e4b9402 100644 (file)
@@ -894,70 +894,71 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxMemoryBuffer& buffer) const
 
 bool wxRegKey::QueryValue(const wxChar *szValue,
                           wxString& strValue,
-                          bool raw) const
+                          bool WXUNUSED_IN_WINCE(raw)) const
 {
-  if ( CONST_CAST Open(Read) ) {
-
-      // first get the type and size of the data
-      DWORD dwType, dwSize;
-      m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
-                                      &dwType, NULL, &dwSize);
-      if ( m_dwLastError == ERROR_SUCCESS ) {
-        if ( !dwSize ) {
-            // must treat this case specially as GetWriteBuf() doesn't like
-            // being called with 0 size
-            strValue.Empty();
-        }
-        else {
-            m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
-                                            WXSTRINGCAST szValue,
-                                            RESERVED,
-                                            &dwType,
-                                            (RegString)(wxChar*)wxStringBuffer(strValue, dwSize),
-                                            &dwSize);
+    if ( CONST_CAST Open(Read) )
+    {
 
-            // expand the var expansions in the string unless disabled
-#ifndef __WXWINCE__
-            if ( (dwType == REG_EXPAND_SZ) && !raw )
+        // first get the type and size of the data
+        DWORD dwType, dwSize;
+        m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
+                                        &dwType, NULL, &dwSize);
+        if ( m_dwLastError == ERROR_SUCCESS )
+        {
+            if ( !dwSize )
             {
-                DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue, NULL, 0);
-                bool ok = dwExpSize != 0;
-                if ( ok )
+                // must treat this case specially as GetWriteBuf() doesn't like
+                // being called with 0 size
+                strValue.Empty();
+            }
+            else
+            {
+                m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
+                                                WXSTRINGCAST szValue,
+                                                RESERVED,
+                                                &dwType,
+                                                (RegString)(wxChar*)wxStringBuffer(strValue, dwSize),
+                                                &dwSize);
+
+                // expand the var expansions in the string unless disabled
+#ifndef __WXWINCE__
+                if ( (dwType == REG_EXPAND_SZ) && !raw )
                 {
-                    wxString strExpValue;
-                    ok = ::ExpandEnvironmentStrings
-                           (
-                            strValue,
-                            wxStringBuffer(strExpValue, dwExpSize),
-                            dwExpSize
-                           ) != 0;
-                    strValue = strExpValue;
-                }
+                    DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue, NULL, 0);
+                    bool ok = dwExpSize != 0;
+                    if ( ok )
+                    {
+                        wxString strExpValue;
+                        ok = ::ExpandEnvironmentStrings(strValue,
+                                                        wxStringBuffer(strExpValue, dwExpSize),
+                                                        dwExpSize
+                                                        ) != 0;
+                        strValue = strExpValue;
+                    }
 
-                if ( !ok )
-                {
-                    wxLogLastError(_T("ExpandEnvironmentStrings"));
+                    if ( !ok )
+                    {
+                        wxLogLastError(_T("ExpandEnvironmentStrings"));
+                    }
                 }
-            }
-#else
-  wxUnusedVar(raw);
 #endif
-            // __WXWINCE__
-        }
+                // __WXWINCE__
+            }
 
-        if ( m_dwLastError == ERROR_SUCCESS ) {
-          // check that it was the right type
-          wxASSERT_MSG( !IsNumericValue(szValue),
-                        wxT("Type mismatch in wxRegKey::QueryValue().") );
+            if ( m_dwLastError == ERROR_SUCCESS )
+            {
+                // check that it was the right type
+                wxASSERT_MSG( !IsNumericValue(szValue),
+                              wxT("Type mismatch in wxRegKey::QueryValue().") );
 
-          return true;
+              return true;
+            }
         }
-      }
-  }
+    }
 
-  wxLogSysError(m_dwLastError, _("Can't read value of '%s'"),
-                GetFullName(this, szValue));
-  return false;
+    wxLogSysError(m_dwLastError, _("Can't read value of '%s'"),
+                  GetFullName(this, szValue));
+    return false;
 }
 
 bool wxRegKey::SetValue(const wxChar *szValue, const wxString& strValue)
index 615451a3f5fdc3672a41775927999f344aed79fa..ac439b82c2b2b1125698cc7a1ff451fddfd6caea 100644 (file)
@@ -888,10 +888,9 @@ unsigned long wxThread::GetCurrentId()
     return (unsigned long)::GetCurrentThreadId();
 }
 
-bool wxThread::SetConcurrency(size_t level)
+bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level))
 {
 #ifdef __WXWINCE__
-    wxUnusedVar(level);
     return false;
 #else
     wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );
index d959e2d5ff77d27acc11cfc92701a2eaea5f09c4..be906d875e71e2db861a03dfe97716758670e287 100644 (file)
@@ -1060,7 +1060,8 @@ void wxWindowMSW::DissociateHandle()
 }
 
 
-bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
+bool wxCheckWindowWndProc(WXHWND hWnd,
+                          WXFARPROC WXUNUSED_IN_WINCE(wndProc))
 {
     // Unicows note: the code below works, but only because WNDCLASS contains
     // original window handler rather that the unicows fake one. This may not
@@ -1072,8 +1073,6 @@ bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc)
     // On WinCE (at least), the wndproc comparison doesn't work,
     // so have to use something like this.
 #ifdef __WXWINCE__
-    wxUnusedVar(wndProc);
-
     extern       wxChar *wxCanvasClassName;
     extern       wxChar *wxCanvasClassNameNR;
     extern const wxChar *wxMDIFrameClassName;
@@ -1418,14 +1417,12 @@ void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
 
 // old style file-manager drag&drop support: we retain the old-style
 // DragAcceptFiles in parallel with SetDropTarget.
-void wxWindowMSW::DragAcceptFiles(bool accept)
+void wxWindowMSW::DragAcceptFiles(bool WXUNUSED_IN_WINCE(accept))
 {
-#if !defined(__WXWINCE__)
+#ifndef __WXWINCE__
     HWND hWnd = GetHwnd();
     if ( hWnd )
         ::DragAcceptFiles(hWnd, (BOOL)accept);
-#else
-    wxUnusedVar(accept);
 #endif
 }
 
@@ -3355,7 +3352,8 @@ bool wxWindowMSW::HandleEndSession(bool endSession, long logOff)
 // window creation/destruction
 // ---------------------------------------------------------------------------
 
-bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
+bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT WXUNUSED_IN_WINCE(cs),
+                               bool *mayCreate)
 {
     // VZ: why is this commented out for WinCE? If it doesn't support
     //     WS_EX_CONTROLPARENT at all it should be somehow handled globally,
@@ -3363,8 +3361,6 @@ bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
 #ifndef __WXWINCE__
     if ( ((CREATESTRUCT *)cs)->dwExStyle & WS_EX_CONTROLPARENT )
         EnsureParentHasControlParentStyle(GetParent());
-#else
-    wxUnusedVar(cs);
 #endif // !__WXWINCE__
 
     // TODO: should generate this event from WM_NCCREATE
@@ -4311,10 +4307,9 @@ bool wxWindowMSW::HandleSizing(wxRect& rect)
     return rc;
 }
 
-bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
+bool wxWindowMSW::HandleGetMinMaxInfo(void *WXUNUSED_IN_WINCE(mmInfo))
 {
 #ifdef __WXWINCE__
-    wxUnusedVar(mmInfo);
     return false;
 #else
     MINMAXINFO *info = (MINMAXINFO *)mmInfo;
@@ -4831,7 +4826,8 @@ bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
     return false;
 }
 
-int wxWindowMSW::HandleMenuChar(int chAccel, WXLPARAM lParam)
+int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel),
+                                WXLPARAM WXUNUSED_IN_WINCE(lParam))
 {
     // FIXME: implement GetMenuItemCount for WinCE, possibly
     // in terms of GetMenuItemInfo
@@ -4889,9 +4885,6 @@ int wxWindowMSW::HandleMenuChar(int chAccel, WXLPARAM lParam)
             wxLogLastError(_T("GetMenuItemInfo"));
         }
     }
-#else
-    wxUnusedVar(chAccel);
-    wxUnusedVar(lParam);
 #endif
     return wxNOT_FOUND;
 }