You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Update HarfBuzz, ICU and FreeType.
HarfBuzz: Update to version 4.2.1 FreeType: Update to version 2.12.1 ICU: Update to version 71.1
This commit is contained in:
43
thirdparty/icu4c/common/uvector.cpp
vendored
43
thirdparty/icu4c/common/uvector.cpp
vendored
@@ -99,14 +99,6 @@ bool UVector::operator==(const UVector& other) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: delete this function once all call sites have been migrated to the
|
||||
// new addElement().
|
||||
void UVector::addElementX(void* obj, UErrorCode &status) {
|
||||
if (ensureCapacityX(count + 1, status)) {
|
||||
elements[count++].pointer = obj;
|
||||
}
|
||||
}
|
||||
|
||||
void UVector::addElement(void* obj, UErrorCode &status) {
|
||||
U_ASSERT(deleter == nullptr);
|
||||
if (ensureCapacity(count + 1, status)) {
|
||||
@@ -331,38 +323,6 @@ int32_t UVector::indexOf(UElement key, int32_t startIndex, int8_t hint) const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
UBool UVector::ensureCapacityX(int32_t minimumCapacity, UErrorCode &status) {
|
||||
if (minimumCapacity < 0) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
if (capacity < minimumCapacity) {
|
||||
if (capacity > (INT32_MAX - 1) / 2) { // integer overflow check
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
int32_t newCap = capacity * 2;
|
||||
if (newCap < minimumCapacity) {
|
||||
newCap = minimumCapacity;
|
||||
}
|
||||
if (newCap > (int32_t)(INT32_MAX / sizeof(UElement))) { // integer overflow check
|
||||
// We keep the original memory contents on bad minimumCapacity.
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
UElement* newElems = (UElement *)uprv_realloc(elements, sizeof(UElement)*newCap);
|
||||
if (newElems == nullptr) {
|
||||
// We keep the original contents on the memory failure on realloc or bad minimumCapacity.
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
elements = newElems;
|
||||
capacity = newCap;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
UBool UVector::ensureCapacity(int32_t minimumCapacity, UErrorCode &status) {
|
||||
if (U_FAILURE(status)) {
|
||||
return false;
|
||||
@@ -370,7 +330,7 @@ UBool UVector::ensureCapacity(int32_t minimumCapacity, UErrorCode &status) {
|
||||
if (minimumCapacity < 0) {
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (capacity < minimumCapacity) {
|
||||
if (capacity > (INT32_MAX - 1) / 2) { // integer overflow check
|
||||
status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
@@ -396,6 +356,7 @@ UBool UVector::ensureCapacity(int32_t minimumCapacity, UErrorCode &status) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the size of this vector as follows: If newSize is smaller,
|
||||
* then truncate the array, possibly deleting held elements for i >=
|
||||
|
||||
Reference in New Issue
Block a user