From 3550b504611b2d9157dcb9750b1442dcefa60f75 Mon Sep 17 00:00:00 2001 From: Andy Robinson Date: Fri, 19 Aug 2016 22:44:23 +0200 Subject: [PATCH] Fix format specifiers used for size_t values in wxFileConfig Fix assert failures when reporting errors in config files under 64 bit systems where "%d" can't be used to output a "size_t" value. See #17630. (cherry picked from commit 75e254fce7f101098481b1628fbea8dbeeb7e773) --- src/common/fileconf.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index e626c3c0cc..4e77aa983d 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -571,7 +571,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) } if ( *pEnd != wxT(']') ) { - wxLogError(_("file '%s': unexpected character %c at line %d."), + wxLogError(_("file '%s': unexpected character %c at line %zu."), buffer.GetName(), *pEnd, n + 1); continue; // skip this line } @@ -607,7 +607,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) break; default: - wxLogWarning(_("file '%s', line %d: '%s' ignored after group header."), + wxLogWarning(_("file '%s', line %zu: '%s' ignored after group header."), buffer.GetName(), n + 1, pEnd); bCont = false; } @@ -636,7 +636,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) pEnd++; if ( *pEnd++ != wxT('=') ) { - wxLogError(_("file '%s', line %d: '=' expected."), + wxLogError(_("file '%s', line %zu: '=' expected."), buffer.GetName(), n + 1); } else { @@ -649,7 +649,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) else { if ( bLocal && pEntry->IsImmutable() ) { // immutable keys can't be changed by user - wxLogWarning(_("file '%s', line %d: value for immutable key '%s' ignored."), + wxLogWarning(_("file '%s', line %zu: value for immutable key '%s' ignored."), buffer.GetName(), n + 1, strKey.c_str()); continue; } @@ -659,8 +659,8 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) // (c) key from global file now found in local one // which is exactly what we want. else if ( !bLocal || pEntry->IsLocal() ) { - wxLogWarning(_("file '%s', line %d: key '%s' was first found at line %d."), - buffer.GetName(), (int)n + 1, strKey.c_str(), pEntry->Line()); + wxLogWarning(_("file '%s', line %zu: key '%s' was first found at line %d."), + buffer.GetName(), n + 1, strKey.c_str(), pEntry->Line()); } }