diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2023-02-21 11:29:08 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 11:29:08 +1000 |
commit | 0d978b5613a1a570395aed831f72a2c603afadab (patch) | |
tree | 8f1c2d6c70e75310ac25a4d276322028a7e62a65 /xbmc/utils/StringUtils.cpp | |
parent | 78c89538658680734a76ce02b17186185f8eb1df (diff) | |
parent | ddb347d01065e4ead12bf544d5f763bdb48b7e2f (diff) |
Merge pull request #22427 from vpeter4/sorting_fix
StringUtils: fix sorting by name with ascii punctuation and symbols o…
Diffstat (limited to 'xbmc/utils/StringUtils.cpp')
-rw-r--r-- | xbmc/utils/StringUtils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp index 50cae977ec..7429223183 100644 --- a/xbmc/utils/StringUtils.cpp +++ b/xbmc/utils/StringUtils.cpp @@ -1135,7 +1135,7 @@ int64_t StringUtils::AlphaNumericCompare(const wchar_t* left, const wchar_t* rig if (lsym && rsym) { if (lc != rc) - return lc - rc; + return static_cast<int64_t>(lc) - static_cast<int64_t>(rc); else { // Same symbol advance to next wchar l++; @@ -1312,7 +1312,7 @@ int StringUtils::AlphaNumericCollation(int nKey1, const void* pKey1, int nKey2, if (lsym && rsym) { if (zA[i] != zB[j]) - return zA[i] - zB[j]; + return static_cast<int>(zA[i]) - static_cast<int>(zB[j]); else { // Same symbol advance to next i++; @@ -1345,7 +1345,7 @@ int StringUtils::AlphaNumericCollation(int nKey1, const void* pKey1, int nKey2, { if (!g_langInfo.UseLocaleCollation() || (lc <= 128 && rc <= 128)) // Compare unicode (having applied accent folding collation to non-ascii chars). - return lc - rc; + return static_cast<int>(lc) - static_cast<int>(rc); else { // Fetch collation facet from locale to do comparison of wide char although on some |