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 75e254fce7)
This commit is contained in:
Andy Robinson
2016-08-19 22:44:23 +02:00
committed by Vadim Zeitlin
parent 238a948ed0
commit 3550b50461

View File

@@ -571,7 +571,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
} }
if ( *pEnd != wxT(']') ) { 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); buffer.GetName(), *pEnd, n + 1);
continue; // skip this line continue; // skip this line
} }
@@ -607,7 +607,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
break; break;
default: 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); buffer.GetName(), n + 1, pEnd);
bCont = false; bCont = false;
} }
@@ -636,7 +636,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
pEnd++; pEnd++;
if ( *pEnd++ != wxT('=') ) { if ( *pEnd++ != wxT('=') ) {
wxLogError(_("file '%s', line %d: '=' expected."), wxLogError(_("file '%s', line %zu: '=' expected."),
buffer.GetName(), n + 1); buffer.GetName(), n + 1);
} }
else { else {
@@ -649,7 +649,7 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
else { else {
if ( bLocal && pEntry->IsImmutable() ) { if ( bLocal && pEntry->IsImmutable() ) {
// immutable keys can't be changed by user // 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()); buffer.GetName(), n + 1, strKey.c_str());
continue; continue;
} }
@@ -659,8 +659,8 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
// (c) key from global file now found in local one // (c) key from global file now found in local one
// which is exactly what we want. // which is exactly what we want.
else if ( !bLocal || pEntry->IsLocal() ) { else if ( !bLocal || pEntry->IsLocal() ) {
wxLogWarning(_("file '%s', line %d: key '%s' was first found at line %d."), wxLogWarning(_("file '%s', line %zu: key '%s' was first found at line %d."),
buffer.GetName(), (int)n + 1, strKey.c_str(), pEntry->Line()); buffer.GetName(), n + 1, strKey.c_str(), pEntry->Line());
} }
} }