aboutsummaryrefslogtreecommitdiff
path: root/xbmc/utils/StringUtils.cpp
diff options
context:
space:
mode:
authorPeter <peter.vicman@gmail.com>2023-01-09 17:49:15 +0100
committerPeter <peter.vicman@gmail.com>2023-01-10 18:31:55 +0100
commitddb347d01065e4ead12bf544d5f763bdb48b7e2f (patch)
treeec9b7bebd59463097b7a0d8def7047e85db759e6 /xbmc/utils/StringUtils.cpp
parent7523e8d04c1c6c219535035e928840bcb48df386 (diff)
StringUtils: fix sorting by name with ascii punctuation and symbols on 32-bit ARM
Diffstat (limited to 'xbmc/utils/StringUtils.cpp')
-rw-r--r--xbmc/utils/StringUtils.cpp6
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