diff options
Diffstat (limited to 'thirdparty/icu4c/common/usc_impl.cpp')
-rw-r--r-- | thirdparty/icu4c/common/usc_impl.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/thirdparty/icu4c/common/usc_impl.cpp b/thirdparty/icu4c/common/usc_impl.cpp index a4e2fc6069..cd5a4e5b8d 100644 --- a/thirdparty/icu4c/common/usc_impl.cpp +++ b/thirdparty/icu4c/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,7 +260,7 @@ 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) { + if (scriptRun == nullptr || scriptRun->scriptLimit >= scriptRun->textLength) { return false; } @@ -268,8 +268,8 @@ uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, U 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,15 +345,15 @@ 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; } |