From b7859132aeb06974f821004cf9ae80ba4a457f7a Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Mon, 31 Oct 2005 20:27:17 +0000 Subject: [PATCH] Modify wxString::operator<<(wxLongLong_t) to avoid warnings from mingw git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure.in | 9 --------- include/wx/string.h | 10 ++++++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/configure.in b/configure.in index 6450784b71..453cd144e3 100644 --- a/configure.in +++ b/configure.in @@ -6978,15 +6978,6 @@ if test "x$INTELCXX" = "xyes" ; then elif test "$GXX" = yes ; then dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy" - - dnl -Wno-format is a terrifically useful warning, however mingw warns - dnl whenever the I64 format specifier is used for long long. - dnl FIXME: it we detected when cygwin is using -mno-cygwin we could avoid - dnl disabling it for cygwin. - case "${host}" in - *-*-cygwin* | *-*-mingw32* ) - CXXWARNINGS="$CXXWARNINGS -Wno-format" - esac fi EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE" diff --git a/include/wx/string.h b/include/wx/string.h index 844cfa9f81..4cd3a70575 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -958,10 +958,16 @@ public: #if defined wxLongLong_t && !defined wxLongLongIsLong // insert a long long if they exist and aren't longs wxString& operator<<(wxLongLong_t ll) - { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("d"), ll); } + { + const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("d"); + return (*this) << Format(fmt, ll); + } // insert an unsigned long long wxString& operator<<(wxULongLong_t ull) - { return (*this) << Format(_T("%") wxLongLongFmtSpec _T("u"), ull); } + { + const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("u"); + return (*this) << Format(fmt , ull); + } #endif // insert a float into string wxString& operator<<(float f)