Helpers in disabling warnings for unused params.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-01 13:39:03 +00:00
parent 2e29e19e7e
commit 0c0d1521c0
9 changed files with 92 additions and 109 deletions

View File

@@ -338,10 +338,9 @@
#ifdef IsMaximized #ifdef IsMaximized
#undef IsMaximized #undef IsMaximized
inline BOOL IsMaximized(HWND hwnd) inline BOOL IsMaximized(HWND WXUNUSED_IN_WINCE(hwnd))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(hwnd);
return FALSE; return FALSE;
#else #else
return IsZoomed(hwnd); return IsZoomed(hwnd);
@@ -353,10 +352,9 @@
#ifdef GetFirstChild #ifdef GetFirstChild
#undef GetFirstChild #undef GetFirstChild
inline HWND GetFirstChild(HWND hwnd) inline HWND GetFirstChild(HWND WXUNUSED_IN_WINCE(hwnd))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(hwnd);
return 0; return 0;
#else #else
return GetTopWindow(hwnd); return GetTopWindow(hwnd);

View File

@@ -40,13 +40,12 @@
#include "wx/msw/missing.h" #include "wx/msw/missing.h"
// Set Unicode format for a common control // Set Unicode format for a common control
inline void wxSetCCUnicodeFormat(HWND hwnd) inline void wxSetCCUnicodeFormat(HWND WXUNUSED_IN_WINCE(hwnd))
{ {
#ifndef __WXWINCE__ #ifndef __WXWINCE__
::SendMessage(hwnd, CCM_SETUNICODEFORMAT, wxUSE_UNICODE, 0); ::SendMessage(hwnd, CCM_SETUNICODEFORMAT, wxUSE_UNICODE, 0);
#else // !__WXWINCE__ #else // !__WXWINCE__
// here it should be already in Unicode anyhow // here it should be already in Unicode anyhow
wxUnusedVar(hwnd);
#endif // __WXWINCE__/!__WXWINCE__ #endif // __WXWINCE__/!__WXWINCE__
} }

View File

@@ -278,10 +278,9 @@ bool wxIsDriveAvailable(const wxString& dirName)
#elif defined(__WINDOWS__) || defined(__OS2__) #elif defined(__WINDOWS__) || defined(__OS2__)
int setdrive(int drive) int setdrive(int WXUNUSED_IN_WINCE(drive))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(drive);
return 0; return 0;
#elif defined(__GNUWIN32__) && \ #elif defined(__GNUWIN32__) && \
(defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
@@ -311,10 +310,9 @@ int setdrive(int drive)
#endif // !GNUWIN32 #endif // !GNUWIN32
} }
bool wxIsDriveAvailable(const wxString& dirName) bool wxIsDriveAvailable(const wxString& WXUNUSED_IN_WINCE(dirName))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(dirName);
return false; return false;
#else #else
#ifdef __WIN32__ #ifdef __WIN32__

View File

@@ -170,15 +170,14 @@ private:
class StretchBltModeChanger class StretchBltModeChanger
{ {
public: public:
StretchBltModeChanger(HDC hdc, int mode) StretchBltModeChanger(HDC hdc,
int WXUNUSED_IN_WINCE(mode))
: m_hdc(hdc) : m_hdc(hdc)
{ {
#ifndef __WXWINCE__ #ifndef __WXWINCE__
m_modeOld = ::SetStretchBltMode(m_hdc, mode); m_modeOld = ::SetStretchBltMode(m_hdc, mode);
if ( !m_modeOld ) if ( !m_modeOld )
wxLogLastError(_T("SetStretchBltMode")); wxLogLastError(_T("SetStretchBltMode"));
#else
wxUnusedVar(mode);
#endif #endif
} }
@@ -560,16 +559,14 @@ void wxDC::Clear()
#endif #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__ #ifdef __WXWINCE__
wxUnusedVar(x);
wxUnusedVar(y);
wxUnusedVar(col);
wxUnusedVar(style);
return false; return false;
#else #else
WXMICROWIN_CHECK_HDC_RET(false) WXMICROWIN_CHECK_HDC_RET(false)
bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
@@ -758,7 +755,11 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
CalcBoundingBox(x, 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 WXMICROWIN_CHECK_HDC
@@ -778,8 +779,6 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffs
} }
#ifndef __WXWINCE__ #ifndef __WXWINCE__
int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING); int prev = SetPolyFillMode(GetHdc(),fillStyle==wxODDEVEN_RULE?ALTERNATE:WINDING);
#else
wxUnusedVar(fillStyle);
#endif #endif
(void)Polygon(GetHdc(), cpoints, n); (void)Polygon(GetHdc(), cpoints, n);
#ifndef __WXWINCE__ #ifndef __WXWINCE__
@@ -1780,7 +1779,8 @@ void wxDC::SetUserScale(double x, double y)
this->SetMapMode(m_mappingMode); 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 WXMICROWIN_CHECK_HDC
@@ -1795,9 +1795,6 @@ void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
SetMapMode(m_mappingMode); SetMapMode(m_mappingMode);
} }
#else
wxUnusedVar(xLeftRight);
wxUnusedVar(yBottomUp);
#endif #endif
} }

View File

@@ -570,7 +570,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
// private functions // private functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxSize wxGetHiconSize(HICON hicon) wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon))
{ {
// default icon size on this hardware // default icon size on this hardware
// usually 32x32 but can be other (smaller) on pocket devices // usually 32x32 but can be other (smaller) on pocket devices
@@ -601,9 +601,8 @@ wxSize wxGetHiconSize(HICON hicon)
::DeleteObject(info.hbmColor); ::DeleteObject(info.hbmColor);
} }
} }
#else
wxUnusedVar(hicon);
#endif #endif
return size; return size;
} }

View File

@@ -979,7 +979,8 @@ bool wxBitmapDataObject::SetData(const wxDataFormat& format,
// wxFileDataObject // 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__ #ifndef __WXWINCE__
m_filenames.Empty(); m_filenames.Empty();
@@ -1015,7 +1016,6 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *pData)
return true; return true;
#else #else
wxUnusedVar(pData);
return false; return false;
#endif #endif
} }
@@ -1055,7 +1055,7 @@ size_t wxFileDataObject::GetDataSize() const
#endif #endif
} }
bool wxFileDataObject::GetDataHere(void *pData) const bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const
{ {
#ifndef __WXWINCE__ #ifndef __WXWINCE__
// pData points to an externally allocated memory block // pData points to an externally allocated memory block
@@ -1095,7 +1095,6 @@ bool wxFileDataObject::GetDataHere(void *pData) const
return true; return true;
#else #else
wxUnusedVar(pData);
return false; return false;
#endif #endif
} }

View File

@@ -894,21 +894,25 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxMemoryBuffer& buffer) const
bool wxRegKey::QueryValue(const wxChar *szValue, bool wxRegKey::QueryValue(const wxChar *szValue,
wxString& strValue, wxString& strValue,
bool raw) const bool WXUNUSED_IN_WINCE(raw)) const
{ {
if ( CONST_CAST Open(Read) ) { if ( CONST_CAST Open(Read) )
{
// first get the type and size of the data // first get the type and size of the data
DWORD dwType, dwSize; DWORD dwType, dwSize;
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED, m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
&dwType, NULL, &dwSize); &dwType, NULL, &dwSize);
if ( m_dwLastError == ERROR_SUCCESS ) { if ( m_dwLastError == ERROR_SUCCESS )
if ( !dwSize ) { {
if ( !dwSize )
{
// must treat this case specially as GetWriteBuf() doesn't like // must treat this case specially as GetWriteBuf() doesn't like
// being called with 0 size // being called with 0 size
strValue.Empty(); strValue.Empty();
} }
else { else
{
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
WXSTRINGCAST szValue, WXSTRINGCAST szValue,
RESERVED, RESERVED,
@@ -925,9 +929,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
if ( ok ) if ( ok )
{ {
wxString strExpValue; wxString strExpValue;
ok = ::ExpandEnvironmentStrings ok = ::ExpandEnvironmentStrings(strValue,
(
strValue,
wxStringBuffer(strExpValue, dwExpSize), wxStringBuffer(strExpValue, dwExpSize),
dwExpSize dwExpSize
) != 0; ) != 0;
@@ -939,13 +941,12 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
wxLogLastError(_T("ExpandEnvironmentStrings")); wxLogLastError(_T("ExpandEnvironmentStrings"));
} }
} }
#else
wxUnusedVar(raw);
#endif #endif
// __WXWINCE__ // __WXWINCE__
} }
if ( m_dwLastError == ERROR_SUCCESS ) { if ( m_dwLastError == ERROR_SUCCESS )
{
// check that it was the right type // check that it was the right type
wxASSERT_MSG( !IsNumericValue(szValue), wxASSERT_MSG( !IsNumericValue(szValue),
wxT("Type mismatch in wxRegKey::QueryValue().") ); wxT("Type mismatch in wxRegKey::QueryValue().") );

View File

@@ -888,10 +888,9 @@ unsigned long wxThread::GetCurrentId()
return (unsigned long)::GetCurrentThreadId(); return (unsigned long)::GetCurrentThreadId();
} }
bool wxThread::SetConcurrency(size_t level) bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(level);
return false; return false;
#else #else
wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );

View 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 // Unicows note: the code below works, but only because WNDCLASS contains
// original window handler rather that the unicows fake one. This may not // 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, // On WinCE (at least), the wndproc comparison doesn't work,
// so have to use something like this. // so have to use something like this.
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(wndProc);
extern wxChar *wxCanvasClassName; extern wxChar *wxCanvasClassName;
extern wxChar *wxCanvasClassNameNR; extern wxChar *wxCanvasClassNameNR;
extern const wxChar *wxMDIFrameClassName; 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 // old style file-manager drag&drop support: we retain the old-style
// DragAcceptFiles in parallel with SetDropTarget. // 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(); HWND hWnd = GetHwnd();
if ( hWnd ) if ( hWnd )
::DragAcceptFiles(hWnd, (BOOL)accept); ::DragAcceptFiles(hWnd, (BOOL)accept);
#else
wxUnusedVar(accept);
#endif #endif
} }
@@ -3355,7 +3352,8 @@ bool wxWindowMSW::HandleEndSession(bool endSession, long logOff)
// window creation/destruction // 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 // VZ: why is this commented out for WinCE? If it doesn't support
// WS_EX_CONTROLPARENT at all it should be somehow handled globally, // WS_EX_CONTROLPARENT at all it should be somehow handled globally,
@@ -3363,8 +3361,6 @@ bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate)
#ifndef __WXWINCE__ #ifndef __WXWINCE__
if ( ((CREATESTRUCT *)cs)->dwExStyle & WS_EX_CONTROLPARENT ) if ( ((CREATESTRUCT *)cs)->dwExStyle & WS_EX_CONTROLPARENT )
EnsureParentHasControlParentStyle(GetParent()); EnsureParentHasControlParentStyle(GetParent());
#else
wxUnusedVar(cs);
#endif // !__WXWINCE__ #endif // !__WXWINCE__
// TODO: should generate this event from WM_NCCREATE // TODO: should generate this event from WM_NCCREATE
@@ -4311,10 +4307,9 @@ bool wxWindowMSW::HandleSizing(wxRect& rect)
return rc; return rc;
} }
bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo) bool wxWindowMSW::HandleGetMinMaxInfo(void *WXUNUSED_IN_WINCE(mmInfo))
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxUnusedVar(mmInfo);
return false; return false;
#else #else
MINMAXINFO *info = (MINMAXINFO *)mmInfo; MINMAXINFO *info = (MINMAXINFO *)mmInfo;
@@ -4831,7 +4826,8 @@ bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
return false; 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 // FIXME: implement GetMenuItemCount for WinCE, possibly
// in terms of GetMenuItemInfo // in terms of GetMenuItemInfo
@@ -4889,9 +4885,6 @@ int wxWindowMSW::HandleMenuChar(int chAccel, WXLPARAM lParam)
wxLogLastError(_T("GetMenuItemInfo")); wxLogLastError(_T("GetMenuItemInfo"));
} }
} }
#else
wxUnusedVar(chAccel);
wxUnusedVar(lParam);
#endif #endif
return wxNOT_FOUND; return wxNOT_FOUND;
} }