summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale_win.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-29 09:07:43 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-02 12:41:07 +0000
commit7c0884f2a2b02ed91ee49f79ef2fff27c2567c39 (patch)
tree64661ff40d4e36b6320c1bd2ff5d15d56a446875 /src/corelib/tools/qlocale_win.cpp
parent30756f4626972d90e1b6e24f495260c1268c9181 (diff)
Windows code: Fix clang-tidy warnings about else after jumps
Replace by switch() where appropriate, remove else and unindent code or simplify the return value. Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qlocale_win.cpp')
-rw-r--r--src/corelib/tools/qlocale_win.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index e1a61fa9d7..4f7b76a0d4 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -365,7 +365,7 @@ QVariant QSystemLocalePrivate::dayName(int day, QLocale::FormatType type)
if (type == QLocale::LongFormat)
return getLocaleInfo(long_day_map[day]);
- else if (type == QLocale::NarrowFormat)
+ if (type == QLocale::NarrowFormat)
return getLocaleInfo(narrow_day_map[day]);
return getLocaleInfo(short_day_map[day]);
}
@@ -386,7 +386,7 @@ QVariant QSystemLocalePrivate::monthName(int month, QLocale::FormatType type)
month -= 1;
if (month < 0 || month > 11)
- return QString();
+ return QString();
LCTYPE lctype = (type == QLocale::ShortFormat || type == QLocale::NarrowFormat)
? short_month_map[month] : long_month_map[month];
@@ -988,7 +988,7 @@ LCID qt_inIsoNametoLCID(const char *name)
// handle norwegian manually, the list above will fail
if (!strncmp(name, "nb", 2))
return 0x0414;
- else if (!strncmp(name, "nn", 2))
+ if (!strncmp(name, "nn", 2))
return 0x0814;
char n[64];
@@ -1099,8 +1099,7 @@ static QByteArray getWinLocaleName(LPWSTR id)
id = qstrtoll(result.data(), 0, 0, &ok);
if ( !ok || id == 0 || id < INT_MIN || id > INT_MAX )
return result;
- else
- return winLangCodeToIsoName( (int)id );
+ return winLangCodeToIsoName(int(id));
}
}