diff options
author | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-14 19:51:50 +0300 |
---|---|---|
committer | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-15 01:24:11 +0300 |
commit | cfcd865e05c0d0525ea27d1e153a043b32a85138 (patch) | |
tree | 68d3b3b25271e8a4998505897a269ff7ce119b76 /contrib/libs/icu/common/propname.cpp | |
parent | ccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff) | |
download | ydb-cfcd865e05c0d0525ea27d1e153a043b32a85138.tar.gz |
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/common/propname.cpp')
-rw-r--r-- | contrib/libs/icu/common/propname.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/contrib/libs/icu/common/propname.cpp b/contrib/libs/icu/common/propname.cpp index a12eb7d913..45062bfbd9 100644 --- a/contrib/libs/icu/common/propname.cpp +++ b/contrib/libs/icu/common/propname.cpp @@ -204,21 +204,21 @@ int32_t PropNameData::findPropertyValueNameGroup(int32_t valueMapIndex, int32_t const char *PropNameData::getName(const char *nameGroup, int32_t nameIndex) { int32_t numNames=*nameGroup++; if(nameIndex<0 || numNames<=nameIndex) { - return NULL; + return nullptr; } // Skip nameIndex names. for(; nameIndex>0; --nameIndex) { nameGroup=uprv_strchr(nameGroup, 0)+1; } if(*nameGroup==0) { - return NULL; // no name (Property[Value]Aliases.txt has "n/a") + return nullptr; // no name (Property[Value]Aliases.txt has "n/a") } return nameGroup; } UBool PropNameData::containsName(BytesTrie &trie, const char *name) { - if(name==NULL) { - return FALSE; + if(name==nullptr) { + return false; } UStringTrieResult result=USTRINGTRIE_NO_VALUE; char c; @@ -229,7 +229,7 @@ UBool PropNameData::containsName(BytesTrie &trie, const char *name) { continue; } if(!USTRINGTRIE_HAS_NEXT(result)) { - return FALSE; + return false; } result=trie.next((uint8_t)c); } @@ -239,7 +239,7 @@ UBool PropNameData::containsName(BytesTrie &trie, const char *name) { const char *PropNameData::getPropertyName(int32_t property, int32_t nameChoice) { int32_t valueMapIndex=findProperty(property); if(valueMapIndex==0) { - return NULL; // Not a known property. + return nullptr; // Not a known property. } return getName(nameGroups+valueMaps[valueMapIndex], nameChoice); } @@ -247,11 +247,11 @@ const char *PropNameData::getPropertyName(int32_t property, int32_t nameChoice) const char *PropNameData::getPropertyValueName(int32_t property, int32_t value, int32_t nameChoice) { int32_t valueMapIndex=findProperty(property); if(valueMapIndex==0) { - return NULL; // Not a known property. + return nullptr; // Not a known property. } int32_t nameGroupOffset=findPropertyValueNameGroup(valueMaps[valueMapIndex+1], value); if(nameGroupOffset==0) { - return NULL; + return nullptr; } return getName(nameGroups+nameGroupOffset, nameChoice); } @@ -289,7 +289,10 @@ U_NAMESPACE_END U_CAPI const char* U_EXPORT2 u_getPropertyName(UProperty property, - UPropertyNameChoice nameChoice) { + UPropertyNameChoice nameChoice) UPRV_NO_SANITIZE_UNDEFINED { + // The nameChoice is really an integer with a couple of named constants. + // Unicode allows for names other than short and long ones. + // If present, these will be returned for U_LONG_PROPERTY_NAME + i, where i=1, 2,... U_NAMESPACE_USE return PropNameData::getPropertyName(property, nameChoice); } @@ -303,7 +306,10 @@ u_getPropertyEnum(const char* alias) { U_CAPI const char* U_EXPORT2 u_getPropertyValueName(UProperty property, int32_t value, - UPropertyNameChoice nameChoice) { + UPropertyNameChoice nameChoice) UPRV_NO_SANITIZE_UNDEFINED { + // The nameChoice is really an integer with a couple of named constants. + // Unicode allows for names other than short and long ones. + // If present, these will be returned for U_LONG_PROPERTY_NAME + i, where i=1, 2,... U_NAMESPACE_USE return PropNameData::getPropertyValueName(property, value, nameChoice); } |