aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/common/uset.cpp
diff options
context:
space:
mode:
authorromankoshelev <romankoshelev@yandex-team.com>2023-08-14 19:51:50 +0300
committerromankoshelev <romankoshelev@yandex-team.com>2023-08-15 01:24:11 +0300
commitcfcd865e05c0d0525ea27d1e153a043b32a85138 (patch)
tree68d3b3b25271e8a4998505897a269ff7ce119b76 /contrib/libs/icu/common/uset.cpp
parentccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff)
downloadydb-cfcd865e05c0d0525ea27d1e153a043b32a85138.tar.gz
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/common/uset.cpp')
-rw-r--r--contrib/libs/icu/common/uset.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/contrib/libs/icu/common/uset.cpp b/contrib/libs/icu/common/uset.cpp
index 871a5d8986..b2d0b91d4b 100644
--- a/contrib/libs/icu/common/uset.cpp
+++ b/contrib/libs/icu/common/uset.cpp
@@ -87,14 +87,14 @@ uset_addRange(USet* set, UChar32 start, UChar32 end) {
}
U_CAPI void U_EXPORT2
-uset_addString(USet* set, const UChar* str, int32_t strLen) {
+uset_addString(USet* set, const char16_t* str, int32_t strLen) {
// UnicodeString handles -1 for strLen
UnicodeString s(strLen<0, str, strLen);
((UnicodeSet*) set)->UnicodeSet::add(s);
}
U_CAPI void U_EXPORT2
-uset_addAllCodePoints(USet* set, const UChar *str, int32_t strLen) {
+uset_addAllCodePoints(USet* set, const char16_t *str, int32_t strLen) {
// UnicodeString handles -1 for strLen
UnicodeString s(str, strLen);
((UnicodeSet*) set)->UnicodeSet::addAll(s);
@@ -111,13 +111,13 @@ uset_removeRange(USet* set, UChar32 start, UChar32 end) {
}
U_CAPI void U_EXPORT2
-uset_removeString(USet* set, const UChar* str, int32_t strLen) {
+uset_removeString(USet* set, const char16_t* str, int32_t strLen) {
UnicodeString s(strLen==-1, str, strLen);
((UnicodeSet*) set)->UnicodeSet::remove(s);
}
U_CAPI void U_EXPORT2
-uset_removeAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_removeAllCodePoints(USet *set, const char16_t *str, int32_t length) {
UnicodeString s(length==-1, str, length);
((UnicodeSet*) set)->UnicodeSet::removeAll(s);
}
@@ -133,13 +133,13 @@ uset_retain(USet* set, UChar32 start, UChar32 end) {
}
U_CAPI void U_EXPORT2
-uset_retainString(USet *set, const UChar *str, int32_t length) {
+uset_retainString(USet *set, const char16_t *str, int32_t length) {
UnicodeString s(length==-1, str, length);
((UnicodeSet*) set)->UnicodeSet::retain(s);
}
U_CAPI void U_EXPORT2
-uset_retainAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_retainAllCodePoints(USet *set, const char16_t *str, int32_t length) {
UnicodeString s(length==-1, str, length);
((UnicodeSet*) set)->UnicodeSet::retainAll(s);
}
@@ -165,13 +165,13 @@ uset_complementRange(USet *set, UChar32 start, UChar32 end) {
}
U_CAPI void U_EXPORT2
-uset_complementString(USet *set, const UChar *str, int32_t length) {
+uset_complementString(USet *set, const char16_t *str, int32_t length) {
UnicodeString s(length==-1, str, length);
((UnicodeSet*) set)->UnicodeSet::complement(s);
}
U_CAPI void U_EXPORT2
-uset_complementAllCodePoints(USet *set, const UChar *str, int32_t length) {
+uset_complementAllCodePoints(USet *set, const char16_t *str, int32_t length) {
UnicodeString s(length==-1, str, length);
((UnicodeSet*) set)->UnicodeSet::complementAll(s);
}
@@ -212,7 +212,7 @@ uset_containsRange(const USet* set, UChar32 start, UChar32 end) {
}
U_CAPI UBool U_EXPORT2
-uset_containsString(const USet* set, const UChar* str, int32_t strLen) {
+uset_containsString(const USet* set, const char16_t* str, int32_t strLen) {
UnicodeString s(strLen==-1, str, strLen);
return ((const UnicodeSet*) set)->UnicodeSet::contains(s);
}
@@ -223,7 +223,7 @@ uset_containsAll(const USet* set1, const USet* set2) {
}
U_CAPI UBool U_EXPORT2
-uset_containsAllCodePoints(const USet* set, const UChar *str, int32_t strLen) {
+uset_containsAllCodePoints(const USet* set, const char16_t *str, int32_t strLen) {
// Create a string alias, since nothing is being added to the set.
UnicodeString s(strLen==-1, str, strLen);
return ((const UnicodeSet*) set)->UnicodeSet::containsAll(s);
@@ -240,12 +240,12 @@ uset_containsSome(const USet* set1, const USet* set2) {
}
U_CAPI int32_t U_EXPORT2
-uset_span(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition) {
+uset_span(const USet *set, const char16_t *s, int32_t length, USetSpanCondition spanCondition) {
return ((UnicodeSet*) set)->UnicodeSet::span(s, length, spanCondition);
}
U_CAPI int32_t U_EXPORT2
-uset_spanBack(const USet *set, const UChar *s, int32_t length, USetSpanCondition spanCondition) {
+uset_spanBack(const USet *set, const char16_t *s, int32_t length, USetSpanCondition spanCondition) {
return ((UnicodeSet*) set)->UnicodeSet::spanBack(s, length, spanCondition);
}
@@ -315,7 +315,7 @@ uset_getItemCount(const USet* uset) {
U_CAPI int32_t U_EXPORT2
uset_getItem(const USet* uset, int32_t itemIndex,
UChar32* start, UChar32* end,
- UChar* str, int32_t strCapacity,
+ char16_t* str, int32_t strCapacity,
UErrorCode* ec) {
if (U_FAILURE(*ec)) return 0;
const UnicodeSet& set = *(const UnicodeSet*)uset;
@@ -344,12 +344,12 @@ uset_getItem(const USet* uset, int32_t itemIndex,
//uset_getRange(const USet* set, int32_t rangeIndex,
// UChar32* pStart, UChar32* pEnd) {
// if ((uint32_t) rangeIndex >= (uint32_t) uset_getRangeCount(set)) {
-// return FALSE;
+// return false;
// }
// const UnicodeSet* us = (const UnicodeSet*) set;
// *pStart = us->getRangeStart(rangeIndex);
// *pEnd = us->getRangeEnd(rangeIndex);
-// return TRUE;
+// return true;
//}
/*
@@ -372,7 +372,7 @@ uset_getItem(const USet* uset, int32_t itemIndex,
*/
U_CAPI int32_t U_EXPORT2
uset_serialize(const USet* set, uint16_t* dest, int32_t destCapacity, UErrorCode* ec) {
- if (ec==NULL || U_FAILURE(*ec)) {
+ if (ec==nullptr || U_FAILURE(*ec)) {
return 0;
}
@@ -383,12 +383,12 @@ U_CAPI UBool U_EXPORT2
uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcLength) {
int32_t length;
- if(fillSet==NULL) {
- return FALSE;
+ if(fillSet==nullptr) {
+ return false;
}
- if(src==NULL || srcLength<=0) {
+ if(src==nullptr || srcLength<=0) {
fillSet->length=fillSet->bmpLength=0;
- return FALSE;
+ return false;
}
length=*src++;
@@ -397,25 +397,25 @@ uset_getSerializedSet(USerializedSet* fillSet, const uint16_t* src, int32_t srcL
length&=0x7fff;
if(srcLength<(2+length)) {
fillSet->length=fillSet->bmpLength=0;
- return FALSE;
+ return false;
}
fillSet->bmpLength=*src++;
} else {
/* only BMP values */
if(srcLength<(1+length)) {
fillSet->length=fillSet->bmpLength=0;
- return FALSE;
+ return false;
}
fillSet->bmpLength=length;
}
fillSet->array=src;
fillSet->length=length;
- return TRUE;
+ return true;
}
U_CAPI void U_EXPORT2
uset_setSerializedToOne(USerializedSet* fillSet, UChar32 c) {
- if(fillSet==NULL || (uint32_t)c>0x10ffff) {
+ if(fillSet==nullptr || (uint32_t)c>0x10ffff) {
return;
}
@@ -450,8 +450,8 @@ U_CAPI UBool U_EXPORT2
uset_serializedContains(const USerializedSet* set, UChar32 c) {
const uint16_t* array;
- if(set==NULL || (uint32_t)c>0x10ffff) {
- return FALSE;
+ if(set==nullptr || (uint32_t)c>0x10ffff) {
+ return false;
}
array=set->array;
@@ -506,7 +506,7 @@ uset_serializedContains(const USerializedSet* set, UChar32 c) {
U_CAPI int32_t U_EXPORT2
uset_getSerializedRangeCount(const USerializedSet* set) {
- if(set==NULL) {
+ if(set==nullptr) {
return 0;
}
@@ -519,8 +519,8 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
const uint16_t* array;
int32_t bmpLength, length;
- if(set==NULL || rangeIndex<0 || pStart==NULL || pEnd==NULL) {
- return FALSE;
+ if(set==nullptr || rangeIndex<0 || pStart==nullptr || pEnd==nullptr) {
+ return false;
}
array=set->array;
@@ -537,7 +537,7 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
} else {
*pEnd=0x10ffff;
}
- return TRUE;
+ return true;
} else {
rangeIndex-=bmpLength;
rangeIndex*=2; /* address pairs of pairs of units */
@@ -551,9 +551,9 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
} else {
*pEnd=0x10ffff;
}
- return TRUE;
+ return true;
} else {
- return FALSE;
+ return false;
}
}
}
@@ -590,15 +590,15 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
// addRemove(USet* set, UChar32 c, int32_t doRemove) {
// int32_t i, length, more;
//
-// if(set==NULL || (uint32_t)c>0x10ffff) {
-// return FALSE;
+// if(set==nullptr || (uint32_t)c>0x10ffff) {
+// return false;
// }
//
// length=set->length;
// i=findChar(set->array, length, c);
// if((i&1)^doRemove) {
// /* c is already in the set */
-// return TRUE;
+// return true;
// }
//
// /* how many more array items do we need? */
@@ -615,7 +615,7 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
// }
// }
// }
-// return TRUE;
+// return true;
// } else if(i>0 && c==set->array[i-1]) {
// /* c is just after the previous range, extend that in-place by one */
// if(++c<=0x10ffff) {
@@ -632,7 +632,7 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
// /* extend the previous range (had limit 0x10ffff) to the end of Unicode */
// set->length=i-1;
// }
-// return TRUE;
+// return true;
// } else if(i==length && c==0x10ffff) {
// /* insert one range limit c */
// more=1;
@@ -646,8 +646,8 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
// /* reallocate */
// int32_t newCapacity=set->capacity+set->capacity/2+USET_GROW_DELTA;
// UChar32* newArray=(UChar32* )uprv_malloc(newCapacity*4);
-// if(newArray==NULL) {
-// return FALSE;
+// if(newArray==nullptr) {
+// return false;
// }
// set->capacity=newCapacity;
// uprv_memcpy(newArray, set->array, length*4);
@@ -667,7 +667,7 @@ uset_getSerializedRange(const USerializedSet* set, int32_t rangeIndex,
// }
// set->length+=more;
//
-// return TRUE;
+// return true;
// }
//
// U_CAPI UBool U_EXPORT2