mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-05 05:25:34 +00:00
parent
90631ab807
commit
75874eb0eb
1 changed files with 15 additions and 3 deletions
|
@ -1577,8 +1577,12 @@ AliasReplacer::replaceTransformedExtensions(
|
|||
tkey = nextTKey;
|
||||
} while (tkey != nullptr);
|
||||
tfields.sort([](UElement e1, UElement e2) -> int8_t {
|
||||
return uprv_strcmp(
|
||||
// uprv_strcmp return int and in some platform, such as arm64-v8a,
|
||||
// it may return positive values > 127 which cause the casted value
|
||||
// of int8_t negative.
|
||||
int res = uprv_strcmp(
|
||||
(const char*)e1.pointer, (const char*)e2.pointer);
|
||||
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
|
||||
}, status);
|
||||
for (int32_t i = 0; i < tfields.size(); i++) {
|
||||
if (output.length() > 0) {
|
||||
|
@ -1618,8 +1622,12 @@ AliasReplacer::outputToString(
|
|||
out.append(SEP_CHAR, status);
|
||||
}
|
||||
variants.sort([](UElement e1, UElement e2) -> int8_t {
|
||||
return uprv_strcmp(
|
||||
// uprv_strcmp return int and in some platform, such as arm64-v8a,
|
||||
// it may return positive values > 127 which cause the casted value
|
||||
// of int8_t negative.
|
||||
int res = uprv_strcmp(
|
||||
(const char*)e1.pointer, (const char*)e2.pointer);
|
||||
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
|
||||
}, status);
|
||||
int32_t variantsStart = out.length();
|
||||
for (int32_t i = 0; i < variants.size(); i++) {
|
||||
|
@ -1680,8 +1688,12 @@ AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status
|
|||
|
||||
// Sort the variants
|
||||
variants.sort([](UElement e1, UElement e2) -> int8_t {
|
||||
return uprv_strcmp(
|
||||
// uprv_strcmp return int and in some platform, such as arm64-v8a,
|
||||
// it may return positive values > 127 which cause the casted value
|
||||
// of int8_t negative.
|
||||
int res = uprv_strcmp(
|
||||
(const char*)e1.pointer, (const char*)e2.pointer);
|
||||
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
|
||||
}, status);
|
||||
|
||||
// A changed count to assert when loop too many times.
|
||||
|
|
Loading…
Add table
Reference in a new issue