diff options
Diffstat (limited to 'thirdparty/icu4c/i18n/scriptset.cpp')
-rw-r--r-- | thirdparty/icu4c/i18n/scriptset.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/thirdparty/icu4c/i18n/scriptset.cpp b/thirdparty/icu4c/i18n/scriptset.cpp index 736a85cf8c..eec1eeb37d 100644 --- a/thirdparty/icu4c/i18n/scriptset.cpp +++ b/thirdparty/icu4c/i18n/scriptset.cpp @@ -57,7 +57,7 @@ UBool ScriptSet::test(UScriptCode script, UErrorCode &status) const { if (U_FAILURE(status)) { return false; } - if (script < 0 || (int32_t)script >= SCRIPT_LIMIT) { + if (script < 0 || static_cast<int32_t>(script) >= SCRIPT_LIMIT) { status = U_ILLEGAL_ARGUMENT_ERROR; return false; } @@ -71,7 +71,7 @@ ScriptSet &ScriptSet::set(UScriptCode script, UErrorCode &status) { if (U_FAILURE(status)) { return *this; } - if (script < 0 || (int32_t)script >= SCRIPT_LIMIT) { + if (script < 0 || static_cast<int32_t>(script) >= SCRIPT_LIMIT) { status = U_ILLEGAL_ARGUMENT_ERROR; return *this; } @@ -85,7 +85,7 @@ ScriptSet &ScriptSet::reset(UScriptCode script, UErrorCode &status) { if (U_FAILURE(status)) { return *this; } - if (script < 0 || (int32_t)script >= SCRIPT_LIMIT) { + if (script < 0 || static_cast<int32_t>(script) >= SCRIPT_LIMIT) { status = U_ILLEGAL_ARGUMENT_ERROR; return *this; } @@ -178,7 +178,7 @@ int32_t ScriptSet::nextSetBit(int32_t fromIndex) const { } UErrorCode status = U_ZERO_ERROR; for (int32_t scriptIndex = fromIndex; scriptIndex < SCRIPT_LIMIT; scriptIndex++) { - if (test((UScriptCode)scriptIndex, status)) { + if (test(static_cast<UScriptCode>(scriptIndex), status)) { return scriptIndex; } } @@ -198,10 +198,10 @@ UnicodeString &ScriptSet::displayScripts(UnicodeString &dest) const { UBool firstTime = true; for (int32_t i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { if (!firstTime) { - dest.append((char16_t)0x20); + dest.append(static_cast<char16_t>(0x20)); } firstTime = false; - const char *scriptName = uscript_getShortName((UScriptCode(i))); + const char* scriptName = uscript_getShortName(static_cast<UScriptCode>(i)); dest.append(UnicodeString(scriptName, -1, US_INV)); } return dest; @@ -230,7 +230,7 @@ ScriptSet &ScriptSet::parseScripts(const UnicodeString &scriptString, UErrorCode if (sc == UCHAR_INVALID_CODE) { status = U_ILLEGAL_ARGUMENT_ERROR; } else { - this->set((UScriptCode)sc, status); + this->set(static_cast<UScriptCode>(sc), status); } if (U_FAILURE(status)) { return *this; |