Avoid some -Wduplicated-branches warnings

This commit is contained in:
Paul Cornett
2022-03-21 11:54:30 -07:00
parent e9e1023393
commit b4475c881a
3 changed files with 26 additions and 43 deletions

View File

@@ -428,52 +428,56 @@ bool wxPrintfConvSpec<CharType>::Parse(const CharType *format)
break;
case wxT('c'):
#if wxUSE_UNICODE
if (ilen == -1)
{
// in Unicode mode %hc == ANSI character
// and in ANSI mode, %hc == %c == ANSI...
// %hc == ANSI character
m_type = wxPAT_CHAR;
}
else if (ilen == 1)
else
{
// in ANSI mode %lc == Unicode character
// and in Unicode mode, %lc == %c == Unicode...
// %lc == %c == Unicode character
m_type = wxPAT_WCHAR;
}
#else
if (ilen == 1)
{
// %lc == Unicode character
m_type = wxPAT_WCHAR;
}
else
{
#if wxUSE_UNICODE
// in Unicode mode, %c == Unicode character
m_type = wxPAT_WCHAR;
#else
// in ANSI mode, %c == ANSI character
// %hc == %c == ANSI character
m_type = wxPAT_CHAR;
#endif
}
#endif
done = true;
break;
case wxT('s'):
#if wxUSE_UNICODE
if (ilen == -1)
{
// Unicode mode wx extension: we'll let %hs mean non-Unicode
// strings (when in ANSI mode, %s == %hs == ANSI string)
// wx extension: we'll let %hs mean non-Unicode strings
m_type = wxPAT_PCHAR;
}
else if (ilen == 1)
else
{
// in Unicode mode, %ls == %s == Unicode string
// in ANSI mode, %ls == Unicode string
// %ls == %s == Unicode string
m_type = wxPAT_PWCHAR;
}
#else
if (ilen == 1)
{
// %ls == Unicode string
m_type = wxPAT_PWCHAR;
}
else
{
#if wxUSE_UNICODE
m_type = wxPAT_PWCHAR;
#else
// %s == %hs == ANSI string
m_type = wxPAT_PCHAR;
#endif
}
#endif
done = true;
break;