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
#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);
@@ -353,10 +352,9 @@
#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);

View File

@@ -40,13 +40,12 @@
#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__
}

View 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__

View 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
}

View 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;
}

View 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
}

View File

@@ -894,21 +894,25 @@ 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) ) {
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 ) {
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 {
else
{
m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
WXSTRINGCAST szValue,
RESERVED,
@@ -925,9 +929,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
if ( ok )
{
wxString strExpValue;
ok = ::ExpandEnvironmentStrings
(
strValue,
ok = ::ExpandEnvironmentStrings(strValue,
wxStringBuffer(strExpValue, dwExpSize),
dwExpSize
) != 0;
@@ -939,13 +941,12 @@ bool wxRegKey::QueryValue(const wxChar *szValue,
wxLogLastError(_T("ExpandEnvironmentStrings"));
}
}
#else
wxUnusedVar(raw);
#endif
// __WXWINCE__
}
if ( m_dwLastError == ERROR_SUCCESS ) {
if ( m_dwLastError == ERROR_SUCCESS )
{
// check that it was the right type
wxASSERT_MSG( !IsNumericValue(szValue),
wxT("Type mismatch in wxRegKey::QueryValue().") );

View 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") );

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
// 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;
}