Skip to content

Commit 55c5895

Browse files
committed
1 parent 531f595 commit 55c5895

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+136
-136
lines changed

icu4c/source/common/propsvec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ upvec_setValue(UPropsVectors *pv,
194194
* input range (only possible for the first and last rows)
195195
* and if their value differs from the input value.
196196
*/
197-
splitFirstRow= (UBool)(start!=(UChar32)firstRow[0] && value!=(firstRow[column]&mask));
198-
splitLastRow= (UBool)(limit!=(UChar32)lastRow[1] && value!=(lastRow[column]&mask));
197+
splitFirstRow = start != static_cast<UChar32>(firstRow[0]) && value != (firstRow[column] & mask);
198+
splitLastRow = limit != static_cast<UChar32>(lastRow[1]) && value != (lastRow[column] & mask);
199199

200200
/* split first/last rows if necessary */
201201
if(splitFirstRow || splitLastRow) {

icu4c/source/common/punycode.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ u_strToPunycode(const char16_t *src, int32_t srcLength,
353353
}
354354

355355
if(destLength<destCapacity) {
356-
dest[destLength]=digitToBasic(q, (UBool)(cpBuffer[j]<0));
356+
dest[destLength] = digitToBasic(q, cpBuffer[j] < 0);
357357
}
358358
++destLength;
359-
bias=adaptBias(delta, handledCPCount+1, (UBool)(handledCPCount==basicLength));
359+
bias = adaptBias(delta, handledCPCount + 1, handledCPCount == basicLength);
360360
delta=0;
361361
++handledCPCount;
362362
}
@@ -500,7 +500,7 @@ u_strFromPunycode(const char16_t *src, int32_t srcLength,
500500
* where needed instead of in for() loop tail.
501501
*/
502502
++destCPCount;
503-
bias=adaptBias(i-oldi, destCPCount, (UBool)(oldi==0));
503+
bias = adaptBias(i - oldi, destCPCount, oldi == 0);
504504

505505
/*
506506
* i was supposed to wrap around from (incremented) destCPCount to 0,

icu4c/source/common/ubidi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ ubidi_setReorderingMode(UBiDi *pBiDi, UBiDiReorderingMode reorderingMode) UPRV_N
304304
if ((pBiDi!=nullptr) && (reorderingMode >= UBIDI_REORDER_DEFAULT)
305305
&& (reorderingMode < UBIDI_REORDER_COUNT)) {
306306
pBiDi->reorderingMode = reorderingMode;
307-
pBiDi->isInverse = (UBool)(reorderingMode == UBIDI_REORDER_INVERSE_NUMBERS_AS_L);
307+
pBiDi->isInverse = reorderingMode == UBIDI_REORDER_INVERSE_NUMBERS_AS_L;
308308
}
309309
}
310310

icu4c/source/common/ucnv_bld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ ucnv_swap(const UDataSwapper *ds,
14401440
MBCS_OPT_UNKNOWN_INCOMPATIBLE_MASK)==0
14411441
) {
14421442
mbcsHeaderLength=mbcsHeader.options&MBCS_OPT_LENGTH_MASK;
1443-
noFromU=(UBool)((mbcsHeader.options&MBCS_OPT_NO_FROM_U)!=0);
1443+
noFromU = (mbcsHeader.options & MBCS_OPT_NO_FROM_U) != 0;
14441444
} else {
14451445
udata_printError(ds, "ucnv_swap(): unsupported _MBCSHeader.version %d.%d\n",
14461446
inMBCSHeader->version[0], inMBCSHeader->version[1]);

icu4c/source/common/ucnvhz.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
389389
}
390390
}
391391
if (targetUniChar != missingCharMarker){
392-
myConverterData->isTargetUCharDBCS = isTargetUCharDBCS = (UBool)(targetUniChar>0x00FF);
392+
myConverterData->isTargetUCharDBCS = isTargetUCharDBCS = targetUniChar > 0x00FF;
393393
if(oldIsTargetUCharDBCS != isTargetUCharDBCS || !myConverterData->isEscapeAppended ){
394394
/*Shifting from a double byte to single byte mode*/
395395
if(!isTargetUCharDBCS){

icu4c/source/common/ucnvmbcs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData,
924924

925925
bytes=mbcsTable->fromUnicodeBytes;
926926

927-
useFallback=(UBool)(which==UCNV_ROUNDTRIP_AND_FALLBACK_SET);
927+
useFallback = which == UCNV_ROUNDTRIP_AND_FALLBACK_SET;
928928

929929
switch(mbcsTable->outputType) {
930930
case MBCS_OUTPUT_3:
@@ -2823,7 +2823,7 @@ ucnv_MBCSToUnicodeWithOffsets(UConverterToUnicodeArgs *pArgs,
28232823
* - If any of the non-initial bytes could be the start of a character,
28242824
* we stop the illegal sequence before the first one of those.
28252825
*/
2826-
UBool isDBCSOnly=(UBool)(cnv->sharedData->mbcs.dbcsOnlyState!=0);
2826+
UBool isDBCSOnly = cnv->sharedData->mbcs.dbcsOnlyState != 0;
28272827
int8_t i;
28282828
for(i=1;
28292829
i<byteIndex && !isSingleOrLead(stateTable, state, isDBCSOnly, bytes[i]);

icu4c/source/common/unicode/unistr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3033,7 +3033,7 @@ class U_COMMON_API UnicodeString : public Replaceable
30333033
* @draft ICU 76
30343034
*/
30353035
inline operator std::u16string_view() const {
3036-
return { getBuffer(), (std::u16string_view::size_type)length() };
3036+
return {getBuffer(), static_cast<std::u16string_view::size_type>(length())};
30373037
}
30383038

30393039
#if U_SIZEOF_WCHAR_T==2 || defined(U_IN_DOXYGEN)

icu4c/source/common/unicode/uset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ class USetStringIterator {
16571657
int32_t length;
16581658
const UChar *uchars = uset_getString(uset, index, &length);
16591659
// assert uchars != nullptr;
1660-
return { ConstChar16Ptr(uchars), (uint32_t)length };
1660+
return {ConstChar16Ptr(uchars), static_cast<uint32_t>(length)};
16611661
}
16621662
return {};
16631663
}

icu4c/source/common/unistr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ U_COMMON_API UnicodeString U_EXPORT2
125125
unistr_internalConcat(const UnicodeString &s1, std::u16string_view s2) {
126126
int32_t sumLengths;
127127
if (s2.length() > INT32_MAX ||
128-
uprv_add32_overflow(s1.length(), (int32_t)s2.length(), &sumLengths)) {
128+
uprv_add32_overflow(s1.length(), static_cast<int32_t>(s2.length()), &sumLengths)) {
129129
UnicodeString bogus;
130130
bogus.setToBogus();
131131
return bogus;
@@ -301,7 +301,7 @@ UnicodeString::UnicodeString(const char *src, int32_t length, EInvariant) {
301301
UnicodeString UnicodeString::readOnlyAliasFromU16StringView(std::u16string_view text) {
302302
UnicodeString result;
303303
if (text.length() <= INT32_MAX) {
304-
result.setTo(false, text.data(), (int32_t)text.length());
304+
result.setTo(false, text.data(), static_cast<int32_t>(text.length()));
305305
} else {
306306
result.setToBogus();
307307
}
@@ -1622,7 +1622,7 @@ UnicodeString::doReplace(int32_t start, int32_t length, std::u16string_view src)
16221622
setToBogus();
16231623
return *this;
16241624
}
1625-
return doReplace(start, length, src.data(), 0, (int32_t)src.length());
1625+
return doReplace(start, length, src.data(), 0, static_cast<int32_t>(src.length()));
16261626
}
16271627

16281628
// Versions of doReplace() only for append() variants.
@@ -1722,7 +1722,7 @@ UnicodeString::doAppend(std::u16string_view src) {
17221722
setToBogus();
17231723
return *this;
17241724
}
1725-
return doAppend(src.data(), 0, (int32_t)src.length());
1725+
return doAppend(src.data(), 0, static_cast<int32_t>(src.length()));
17261726
}
17271727

17281728
/**

icu4c/source/common/ushape.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,13 +1709,13 @@ u_shapeArabic(const char16_t *source, int32_t sourceLength,
17091709
case U_SHAPE_DIGITS_ALEN2AN_INIT_LR:
17101710
_shapeToArabicDigitsWithContext(dest, destLength,
17111711
digitBase,
1712-
(UBool)((options&U_SHAPE_TEXT_DIRECTION_MASK)==U_SHAPE_TEXT_DIRECTION_LOGICAL),
1712+
(options & U_SHAPE_TEXT_DIRECTION_MASK) == U_SHAPE_TEXT_DIRECTION_LOGICAL,
17131713
false);
17141714
break;
17151715
case U_SHAPE_DIGITS_ALEN2AN_INIT_AL:
17161716
_shapeToArabicDigitsWithContext(dest, destLength,
17171717
digitBase,
1718-
(UBool)((options&U_SHAPE_TEXT_DIRECTION_MASK)==U_SHAPE_TEXT_DIRECTION_LOGICAL),
1718+
(options & U_SHAPE_TEXT_DIRECTION_MASK) == U_SHAPE_TEXT_DIRECTION_LOGICAL,
17191719
true);
17201720
break;
17211721
default:

0 commit comments

Comments
 (0)