diff options
| author | romankoshelev <[email protected]> | 2023-08-14 19:51:50 +0300 |
|---|---|---|
| committer | romankoshelev <[email protected]> | 2023-08-15 01:24:11 +0300 |
| commit | cfcd865e05c0d0525ea27d1e153a043b32a85138 (patch) | |
| tree | 68d3b3b25271e8a4998505897a269ff7ce119b76 /contrib/libs/icu/common/usc_impl.cpp | |
| parent | ccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff) | |
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/common/usc_impl.cpp')
| -rw-r--r-- | contrib/libs/icu/common/usc_impl.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/libs/icu/common/usc_impl.cpp b/contrib/libs/icu/common/usc_impl.cpp index 111029b9749..cd5a4e5b8db 100644 --- a/contrib/libs/icu/common/usc_impl.cpp +++ b/contrib/libs/icu/common/usc_impl.cpp @@ -41,7 +41,7 @@ struct ParenStackEntry struct UScriptRun { int32_t textLength; - const UChar *textArray; + const char16_t *textArray; int32_t scriptStart; int32_t scriptLimit; @@ -189,19 +189,19 @@ sameScript(UScriptCode scriptOne, UScriptCode scriptTwo) } U_CAPI UScriptRun * U_EXPORT2 -uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode) +uscript_openRun(const char16_t *src, int32_t length, UErrorCode *pErrorCode) { - UScriptRun *result = NULL; + UScriptRun *result = nullptr; - if (pErrorCode == NULL || U_FAILURE(*pErrorCode)) { - return NULL; + if (pErrorCode == nullptr || U_FAILURE(*pErrorCode)) { + return nullptr; } result = (UScriptRun *)uprv_malloc(sizeof (UScriptRun)); - if (result == NULL) { + if (result == nullptr) { *pErrorCode = U_MEMORY_ALLOCATION_ERROR; - return NULL; + return nullptr; } uscript_setRunText(result, src, length, pErrorCode); @@ -209,7 +209,7 @@ uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode) /* Release the UScriptRun if uscript_setRunText() returns an error */ if (U_FAILURE(*pErrorCode)) { uprv_free(result); - result = NULL; + result = nullptr; } return result; @@ -218,7 +218,7 @@ uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode) U_CAPI void U_EXPORT2 uscript_closeRun(UScriptRun *scriptRun) { - if (scriptRun != NULL) { + if (scriptRun != nullptr) { uprv_free(scriptRun); } } @@ -226,7 +226,7 @@ uscript_closeRun(UScriptRun *scriptRun) U_CAPI void U_EXPORT2 uscript_resetRun(UScriptRun *scriptRun) { - if (scriptRun != NULL) { + if (scriptRun != nullptr) { scriptRun->scriptStart = 0; scriptRun->scriptLimit = 0; scriptRun->scriptCode = USCRIPT_INVALID_CODE; @@ -237,13 +237,13 @@ uscript_resetRun(UScriptRun *scriptRun) } U_CAPI void U_EXPORT2 -uscript_setRunText(UScriptRun *scriptRun, const UChar *src, int32_t length, UErrorCode *pErrorCode) +uscript_setRunText(UScriptRun *scriptRun, const char16_t *src, int32_t length, UErrorCode *pErrorCode) { - if (pErrorCode == NULL || U_FAILURE(*pErrorCode)) { + if (pErrorCode == nullptr || U_FAILURE(*pErrorCode)) { return; } - if (scriptRun == NULL || length < 0 || ((src == NULL) != (length == 0))) { + if (scriptRun == nullptr || length < 0 || ((src == nullptr) != (length == 0))) { *pErrorCode = U_ILLEGAL_ARGUMENT_ERROR; return; } @@ -260,16 +260,16 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U UErrorCode error = U_ZERO_ERROR; /* if we've fallen off the end of the text, we're done */ - if (scriptRun == NULL || scriptRun->scriptLimit >= scriptRun->textLength) { - return FALSE; + if (scriptRun == nullptr || scriptRun->scriptLimit >= scriptRun->textLength) { + return false; } SYNC_FIXUP(scriptRun); scriptRun->scriptCode = USCRIPT_COMMON; for (scriptRun->scriptStart = scriptRun->scriptLimit; scriptRun->scriptLimit < scriptRun->textLength; scriptRun->scriptLimit += 1) { - UChar high = scriptRun->textArray[scriptRun->scriptLimit]; - UChar32 ch = high; + char16_t high = scriptRun->textArray[scriptRun->scriptLimit]; + UChar32 ch = high; UScriptCode sc; int32_t pairIndex; @@ -278,7 +278,7 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U * in the text, see if it's followed by a low surrogate */ if (high >= 0xD800 && high <= 0xDBFF && scriptRun->scriptLimit < scriptRun->textLength - 1) { - UChar low = scriptRun->textArray[scriptRun->scriptLimit + 1]; + char16_t low = scriptRun->textArray[scriptRun->scriptLimit + 1]; /* * if it is followed by a low surrogate, @@ -345,17 +345,17 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U } - if (pRunStart != NULL) { + if (pRunStart != nullptr) { *pRunStart = scriptRun->scriptStart; } - if (pRunLimit != NULL) { + if (pRunLimit != nullptr) { *pRunLimit = scriptRun->scriptLimit; } - if (pRunScript != NULL) { + if (pRunScript != nullptr) { *pRunScript = scriptRun->scriptCode; } - return TRUE; + return true; } |
