diff options
Diffstat (limited to 'thirdparty/icu4c/common/ucnv.cpp')
-rw-r--r-- | thirdparty/icu4c/common/ucnv.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/thirdparty/icu4c/common/ucnv.cpp b/thirdparty/icu4c/common/ucnv.cpp index 34a5a203d0..c66200b793 100644 --- a/thirdparty/icu4c/common/ucnv.cpp +++ b/thirdparty/icu4c/common/ucnv.cpp @@ -916,7 +916,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) { * s<sourceLimit before converterSawEndOfInput is checked */ converterSawEndOfInput= - (UBool)(U_SUCCESS(*err) && + static_cast<UBool>(U_SUCCESS(*err) && pArgs->flush && pArgs->source==pArgs->sourceLimit && cnv->fromUChar32==0); } else { @@ -941,7 +941,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) { for(;;) { /* update offsets if we write any */ if(offsets!=nullptr) { - int32_t length=(int32_t)(pArgs->target-t); + int32_t length = static_cast<int32_t>(pArgs->target - t); if(length>0) { _updateOffsets(offsets, length, sourceIndex, errorInputLength); @@ -956,7 +956,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) { } if(sourceIndex>=0) { - sourceIndex+=(int32_t)(pArgs->source-s); + sourceIndex += static_cast<int32_t>(pArgs->source - s); } } @@ -1066,10 +1066,10 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) { U_ASSERT(cnv->preFromULength==0); - length=(int32_t)(pArgs->sourceLimit-pArgs->source); + length = static_cast<int32_t>(pArgs->sourceLimit - pArgs->source); if(length>0) { u_memcpy(cnv->preFromU, pArgs->source, length); - cnv->preFromULength=(int8_t)-length; + cnv->preFromULength = static_cast<int8_t>(-length); } pArgs->source=realSource; @@ -1089,7 +1089,7 @@ _fromUnicodeWithCallback(UConverterFromUnicodeArgs *pArgs, UErrorCode *err) { codePoint=cnv->fromUChar32; errorInputLength=0; U16_APPEND_UNSAFE(cnv->invalidUCharBuffer, errorInputLength, codePoint); - cnv->invalidUCharLength=(int8_t)errorInputLength; + cnv->invalidUCharLength = static_cast<int8_t>(errorInputLength); /* set the converter state to deal with the next character */ cnv->fromUChar32=0; @@ -1134,7 +1134,7 @@ ucnv_outputOverflowFromUnicode(UConverter *cnv, offsets=nullptr; } - overflow=(char *)cnv->charErrorBuffer; + overflow = reinterpret_cast<char*>(cnv->charErrorBuffer); length=cnv->charErrorBufferLength; i=0; while(i<length) { @@ -1146,7 +1146,7 @@ ucnv_outputOverflowFromUnicode(UConverter *cnv, overflow[j++]=overflow[i++]; } while(i<length); - cnv->charErrorBufferLength=(int8_t)j; + cnv->charErrorBufferLength = static_cast<int8_t>(j); *target=t; if(offsets!=nullptr) { *pOffsets=offsets; @@ -1361,7 +1361,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { * s<sourceLimit before converterSawEndOfInput is checked */ converterSawEndOfInput= - (UBool)(U_SUCCESS(*err) && + static_cast<UBool>(U_SUCCESS(*err) && pArgs->flush && pArgs->source==pArgs->sourceLimit && cnv->toULength==0); } else { @@ -1386,7 +1386,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { for(;;) { /* update offsets if we write any */ if(offsets!=nullptr) { - int32_t length=(int32_t)(pArgs->target-t); + int32_t length = static_cast<int32_t>(pArgs->target - t); if(length>0) { _updateOffsets(offsets, length, sourceIndex, errorInputLength); @@ -1401,7 +1401,7 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { } if(sourceIndex>=0) { - sourceIndex+=(int32_t)(pArgs->source-s); + sourceIndex += static_cast<int32_t>(pArgs->source - s); } } @@ -1513,10 +1513,10 @@ _toUnicodeWithCallback(UConverterToUnicodeArgs *pArgs, UErrorCode *err) { U_ASSERT(cnv->preToULength==0); - length=(int32_t)(pArgs->sourceLimit-pArgs->source); + length = static_cast<int32_t>(pArgs->sourceLimit - pArgs->source); if(length>0) { uprv_memcpy(cnv->preToU, pArgs->source, length); - cnv->preToULength=(int8_t)-length; + cnv->preToULength = static_cast<int8_t>(-length); } pArgs->source=realSource; @@ -1592,7 +1592,7 @@ ucnv_outputOverflowToUnicode(UConverter *cnv, overflow[j++]=overflow[i++]; } while(i<length); - cnv->UCharErrorBufferLength=(int8_t)j; + cnv->UCharErrorBufferLength = static_cast<int8_t>(j); *target=t; if(offsets!=nullptr) { *pOffsets=offsets; @@ -2437,7 +2437,7 @@ ucnv_internalConvert(UConverter *outConverter, UConverter *inConverter, false, true, pErrorCode); - targetLength=(int32_t)(myTarget-target); + targetLength = static_cast<int32_t>(myTarget - target); } /* @@ -2460,7 +2460,7 @@ ucnv_internalConvert(UConverter *outConverter, UConverter *inConverter, false, true, pErrorCode); - targetLength+=(int32_t)(myTarget-targetBuffer); + targetLength += static_cast<int32_t>(myTarget - targetBuffer); } while(*pErrorCode==U_BUFFER_OVERFLOW_ERROR); /* done with preflighting, set warnings and errors as appropriate */ @@ -2684,7 +2684,7 @@ ucnv_fixFileSeparator(const UConverter *cnv, U_CAPI UBool U_EXPORT2 ucnv_isAmbiguous(const UConverter *cnv) { - return (UBool)(ucnv_getAmbiguous(cnv)!=nullptr); + return ucnv_getAmbiguous(cnv)!=nullptr; } U_CAPI void U_EXPORT2 |