From e22fa4d7b2608c333d8ffdb9807973b6967a2087 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Jul 2010 23:32:30 +0000 Subject: [PATCH] Fix mismatches between format strings and arguments. This corrects the asserts which are now triggered when the actual arguments don't match the format string. Closes #12265. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/drawing/drawing.cpp | 2 +- src/aui/framemanager.cpp | 2 +- utils/wxrc/wxrc.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index e40144364d..80437e10b4 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -764,7 +764,7 @@ void MyCanvas::DrawText(wxDC& dc) wxCoord height; wxCoord descent; dc.GetTextExtent( wxT("This is Swiss 18pt text."), &length, &height, &descent ); - text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent ); + text.Printf( wxT("Dimensions are length %d, height %d, descent %d"), length, height, descent ); dc.DrawText( text, 110, 80 ); text.Printf( wxT("CharHeight() returns: %d"), dc.GetCharHeight() ); diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 3680831e6c..7e66858fc2 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -1004,7 +1004,7 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) if (pinfo.name.empty() || already_exists) { pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"), - wxPtrToUInt(pinfo.window) & 0xffffffff, + (unsigned long)(wxPtrToUInt(pinfo.window) & 0xffffffff), (unsigned int)time(NULL), #ifdef __WXWINCE__ (unsigned int)GetTickCount(), diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 9a309dbf5e..d54dab604e 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -586,7 +586,8 @@ static wxString FileToCppArray(wxString filename, int num) wxT("Huge file not supported") ); snum.Printf(wxT("%i"), num); - output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %zu;\n"), lng); + output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %lu;\n"), + static_cast(lng)); output += wxT("static unsigned char xml_res_file_") + snum + wxT("[] = {\n"); // we cannot use string literals because MSVC is dumb wannabe compiler // with arbitrary limitation to 2048 strings :( -- 2.45.2