Remove harmless unused variables warnings in non-debug build

Suppress a few -Wunused-variable and -Wunused-parameter warnings when
using --disable-debug.
This commit is contained in:
Vadim Zeitlin
2021-02-14 12:43:30 +01:00
parent 70793777b6
commit d89d3b6851
3 changed files with 6 additions and 3 deletions

View File

@@ -46,8 +46,10 @@ extern WXDLLIMPEXP_DATA_NET(const char) wxWebSessionBackendCURL[] = "CURL";
wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_STATE, wxWebRequestEvent);
wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent); wxDEFINE_EVENT(wxEVT_WEBREQUEST_DATA, wxWebRequestEvent);
#ifdef __WXDEBUG__
static const wxStringCharType* wxNO_IMPL_MSG static const wxStringCharType* wxNO_IMPL_MSG
= wxS("can't be used with an invalid/uninitialized object"); = wxS("can't be used with an invalid/uninitialized object");
#endif
#define wxCHECK_IMPL(rc) wxCHECK_MSG( m_impl, (rc), wxNO_IMPL_MSG ) #define wxCHECK_IMPL(rc) wxCHECK_MSG( m_impl, (rc), wxNO_IMPL_MSG )
#define wxCHECK_IMPL_VOID() wxCHECK_RET( m_impl, wxNO_IMPL_MSG ) #define wxCHECK_IMPL_VOID() wxCHECK_RET( m_impl, wxNO_IMPL_MSG )

View File

@@ -1411,19 +1411,19 @@ bool wxBitmap::HasAlpha() const
} }
#if WXWIN_COMPATIBILITY_3_0 #if WXWIN_COMPATIBILITY_3_0
void wxBitmap::SetWidth(int w) void wxBitmap::SetWidth(int WXUNUSED_UNLESS_DEBUG(w))
{ {
AllocExclusive(); AllocExclusive();
wxASSERT_MSG( GetWidth() == w, "Changing the bitmap width is not supported"); wxASSERT_MSG( GetWidth() == w, "Changing the bitmap width is not supported");
} }
void wxBitmap::SetHeight(int h) void wxBitmap::SetHeight(int WXUNUSED_UNLESS_DEBUG(h))
{ {
AllocExclusive(); AllocExclusive();
wxASSERT_MSG( GetHeight() == h, "Changing the bitmap height is not supported"); wxASSERT_MSG( GetHeight() == h, "Changing the bitmap height is not supported");
} }
void wxBitmap::SetDepth(int d) void wxBitmap::SetDepth(int WXUNUSED_UNLESS_DEBUG(d))
{ {
AllocExclusive(); AllocExclusive();
wxASSERT_MSG( d == -1 || GetDepth() == d, "Changing the bitmap depth is not supported"); wxASSERT_MSG( d == -1 || GetDepth() == d, "Changing the bitmap depth is not supported");

View File

@@ -226,6 +226,7 @@ int wxDisplayFactoryMacOSX::GetFromPoint(const wxPoint& p)
CGDisplayCount theCount; CGDisplayCount theCount;
CGDisplayErr err = CGGetDisplaysWithPoint(thePoint, 1, &theID, &theCount); CGDisplayErr err = CGGetDisplaysWithPoint(thePoint, 1, &theID, &theCount);
wxASSERT(err == CGDisplayNoErr); wxASSERT(err == CGDisplayNoErr);
wxUnusedVar(err); // suppress "unused" warning in non-debug builds
if (theCount) if (theCount)
return wxOSXGetDisplayFromID(theID); return wxOSXGetDisplayFromID(theID);