X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b4a88f4db1d47c743e9bd2def5593679f72f903..438959cca892a7651634cc3a7aad4819ac49b23c:/include/wx/strvararg.h diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index 933c452f6c..8f2d16551e 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -160,7 +160,7 @@ public: Arg_Pointer = 0x0002, // %p Arg_String = 0x0004 | Arg_Pointer, // any form of string (%s and %p too) - Arg_Int = 0x0008, + Arg_Int = 0x0008 | Arg_Char, // (ints can be used with %c) #if SIZEOF_INT == SIZEOF_LONG Arg_LongInt = Arg_Int, #else @@ -207,7 +207,7 @@ public: { return const_cast(this)->AsChar(); } private: // InputAsChar() returns the value passed to ctor, only converted - // to char, while AsChar() takes the the string returned by InputAsChar() + // to char, while AsChar() takes the string returned by InputAsChar() // and does format string conversion on it as well (and similarly for // ..AsWChar() below) const char* InputAsChar(); @@ -309,16 +309,19 @@ struct wxFormatStringArgumentFinder // the correct type (one of wxFormatString::Arg_XXX or-combination in // 'expected_mask'). #define wxASSERT_ARG_TYPE(fmt, index, expected_mask) \ - do \ - { \ + wxSTATEMENT_MACRO_BEGIN \ if ( !fmt ) \ break; \ const int argtype = fmt->GetArgumentType(index); \ wxASSERT_MSG( (argtype & (expected_mask)) == argtype, \ "format specifier doesn't match argument type" ); \ - } while ( wxFalse ) + wxSTATEMENT_MACRO_END #else - #define wxASSERT_ARG_TYPE(fmt, index, expected_mask) + // Just define it to suppress "unused parameter" warnings for the + // parameters which we don't use otherwise + #define wxASSERT_ARG_TYPE(fmt, index, expected_mask) \ + wxUnusedVar(fmt); \ + wxUnusedVar(index) #endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL @@ -821,7 +824,7 @@ WX_ARG_NORMALIZER_FORWARD(const signed char&, signed char); #undef WX_ARG_NORMALIZER_FORWARD #undef _WX_ARG_NORMALIZER_FORWARD_IMPL -#undef wxASSERT_ARG_TYPE +// NB: Don't #undef wxASSERT_ARG_TYPE here as it's also used in wx/longlong.h. // ---------------------------------------------------------------------------- // WX_VA_ARG_STRING