feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -51,10 +51,10 @@ void UVector64::_init(int32_t initialCapacity, UErrorCode &status) {
if (maxCapacity>0 && maxCapacity<initialCapacity) {
initialCapacity = maxCapacity;
}
if (initialCapacity > (int32_t)(INT32_MAX / sizeof(int64_t))) {
if (initialCapacity > static_cast<int32_t>(INT32_MAX / sizeof(int64_t))) {
initialCapacity = uprv_min(DEFAULT_CAPACITY, maxCapacity);
}
elements = (int64_t *)uprv_malloc(sizeof(int64_t)*initialCapacity);
elements = static_cast<int64_t*>(uprv_malloc(sizeof(int64_t) * initialCapacity));
if (elements == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
} else {
@ -141,12 +141,12 @@ UBool UVector64::expandCapacity(int32_t minimumCapacity, UErrorCode &status) {
if (maxCapacity > 0 && newCap > maxCapacity) {
newCap = maxCapacity;
}
if (newCap > (int32_t)(INT32_MAX / sizeof(int64_t))) { // integer overflow check
if (newCap > static_cast<int32_t>(INT32_MAX / sizeof(int64_t))) { // integer overflow check
// We keep the original memory contents on bad minimumCapacity/maxCapacity.
status = U_ILLEGAL_ARGUMENT_ERROR;
return false;
}
int64_t* newElems = (int64_t *)uprv_realloc(elements, sizeof(int64_t)*newCap);
int64_t* newElems = static_cast<int64_t*>(uprv_realloc(elements, sizeof(int64_t) * newCap));
if (newElems == nullptr) {
// We keep the original contents on the memory failure on realloc.
status = U_MEMORY_ALLOCATION_ERROR;
@ -162,7 +162,7 @@ void UVector64::setMaxCapacity(int32_t limit) {
if (limit < 0) {
limit = 0;
}
if (limit > (int32_t)(INT32_MAX / sizeof(int64_t))) { // integer overflow check for realloc
if (limit > static_cast<int32_t>(INT32_MAX / sizeof(int64_t))) { // integer overflow check for realloc
// Something is very wrong, don't realloc, leave capacity and maxCapacity unchanged
return;
}
@ -174,7 +174,7 @@ void UVector64::setMaxCapacity(int32_t limit) {
// New maximum capacity is smaller than the current size.
// Realloc the storage to the new, smaller size.
int64_t* newElems = (int64_t *)uprv_realloc(elements, sizeof(int64_t)*maxCapacity);
int64_t* newElems = static_cast<int64_t*>(uprv_realloc(elements, sizeof(int64_t) * maxCapacity));
if (newElems == nullptr) {
// Realloc to smaller failed.
// Just keep what we had. No need to call it a failure.