diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index c0757fc2f2d3..df6211947027 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -1570,7 +1570,7 @@ AliasReplacer::replaceTransformedExtensions( // Split the "tkey-tvalue" pair string so that we can canonicalize the tvalue. *const_cast(tvalue++) = '\0'; // NUL terminate tkey output.append(tfield, status).append('-', status); - const char* bcpTValue = ulocimp_toBcpType(tfield, tvalue, nullptr, nullptr); + const char* bcpTValue = ulocimp_toBcpType(tfield, tvalue); output.append((bcpTValue == nullptr) ? tvalue : bcpTValue, status); } } diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 3a4d3b595417..c2b7bbfd6af0 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -2296,7 +2296,7 @@ uloc_toUnicodeLocaleKey(const char* keyword) U_CAPI const char* U_EXPORT2 uloc_toUnicodeLocaleType(const char* keyword, const char* value) { - const char* bcpType = ulocimp_toBcpType(keyword, value, nullptr, nullptr); + const char* bcpType = ulocimp_toBcpType(keyword, value); if (bcpType == nullptr && ultag_isUnicodeLocaleType(value, -1)) { // unknown keyword, but syntax is fine.. return value; @@ -2364,7 +2364,7 @@ uloc_toLegacyKey(const char* keyword) U_CAPI const char* U_EXPORT2 uloc_toLegacyType(const char* keyword, const char* value) { - const char* legacyType = ulocimp_toLegacyType(keyword, value, nullptr, nullptr); + const char* legacyType = ulocimp_toLegacyType(keyword, value); if (legacyType == nullptr) { // Checks if the specified locale type is well-formed with the legacy locale syntax. // diff --git a/icu4c/source/common/uloc_keytype.cpp b/icu4c/source/common/uloc_keytype.cpp index e374da450b5c..6ea886ca295c 100644 --- a/icu4c/source/common/uloc_keytype.cpp +++ b/icu4c/source/common/uloc_keytype.cpp @@ -449,23 +449,13 @@ ulocimp_toLegacyKey(const char* key) { } U_EXPORT const char* -ulocimp_toBcpType(const char* key, const char* type, bool* isKnownKey, bool* isSpecialType) { - if (isKnownKey != nullptr) { - *isKnownKey = false; - } - if (isSpecialType != nullptr) { - *isSpecialType = false; - } - +ulocimp_toBcpType(const char* key, const char* type) { if (!init()) { return nullptr; } LocExtKeyData* keyData = static_cast(uhash_get(gLocExtKeyMap, key)); if (keyData != nullptr) { - if (isKnownKey != nullptr) { - *isKnownKey = true; - } LocExtType* t = static_cast(uhash_get(keyData->typeMap.getAlias(), type)); if (t != nullptr) { return t->bcpId; @@ -482,9 +472,6 @@ ulocimp_toBcpType(const char* key, const char* type, bool* isKnownKey, bool* isS matched = isSpecialTypeRgKeyValue(type); } if (matched) { - if (isSpecialType != nullptr) { - *isSpecialType = true; - } return type; } } @@ -494,23 +481,13 @@ ulocimp_toBcpType(const char* key, const char* type, bool* isKnownKey, bool* isS U_EXPORT const char* -ulocimp_toLegacyType(const char* key, const char* type, bool* isKnownKey, bool* isSpecialType) { - if (isKnownKey != nullptr) { - *isKnownKey = false; - } - if (isSpecialType != nullptr) { - *isSpecialType = false; - } - +ulocimp_toLegacyType(const char* key, const char* type) { if (!init()) { return nullptr; } LocExtKeyData* keyData = static_cast(uhash_get(gLocExtKeyMap, key)); if (keyData != nullptr) { - if (isKnownKey != nullptr) { - *isKnownKey = true; - } LocExtType* t = static_cast(uhash_get(keyData->typeMap.getAlias(), type)); if (t != nullptr) { return t->legacyId; @@ -527,9 +504,6 @@ ulocimp_toLegacyType(const char* key, const char* type, bool* isKnownKey, bool* matched = isSpecialTypeRgKeyValue(type); } if (matched) { - if (isSpecialType != nullptr) { - *isSpecialType = true; - } return type; } } diff --git a/icu4c/source/common/ulocimp.h b/icu4c/source/common/ulocimp.h index 7fb64062884c..ff3910ac8f35 100644 --- a/icu4c/source/common/ulocimp.h +++ b/icu4c/source/common/ulocimp.h @@ -398,10 +398,10 @@ U_EXPORT const char* ulocimp_toLegacyKey(const char* key); U_EXPORT const char* -ulocimp_toBcpType(const char* key, const char* type, bool* isKnownKey, bool* isSpecialType); +ulocimp_toBcpType(const char* key, const char* type); U_EXPORT const char* -ulocimp_toLegacyType(const char* key, const char* type, bool* isKnownKey, bool* isSpecialType); +ulocimp_toLegacyType(const char* key, const char* type); /* Function for testing purpose */ U_EXPORT const char* const*