if (U_SUCCESS(status)) {
CharString newVar;
if (begin != variants) {
- newVar.append(variants, begin - variants - 1, status);
+ newVar.append(variants, static_cast<int32_t>(begin - variants - 1), status);
}
if (end != nullptr) {
if (begin != variants) {
*status = U_BUFFER_OVERFLOW_ERROR;
return string;
} else {
- spec->locale.copyFrom(CharString(string, end-string, *status), *status);
+ spec->locale.copyFrom(CharString(string, static_cast<int32_t>(end-string), *status), *status);
return end+1;
}
}
unsigned int RBBIMonkeyKind::maxClassNameSize() {
unsigned int maxSize = 0;
for (int aClassNum = 0; aClassNum < charClasses()->size(); aClassNum++) {
- if (classNames[aClassNum].size() > maxSize) {
- maxSize = classNames[aClassNum].size();
+ auto aClassNumSize = static_cast<unsigned int>(classNames[aClassNum].size());
+ if (aClassNumSize > maxSize) {
+ maxSize = aClassNumSize;
}
}
return maxSize;
StringTest::TestUpperOrdinal() {
for (int32_t i = 0;; ++i) {
char ic = nativeInvChars[i];
- uint8_t ac = asciiInvChars[i];
+ uint8_t ac = static_cast<uint8_t>(asciiInvChars[i]);
int32_t expected = ac - 'A';
int32_t actual = uprv_upperOrdinal(ic);
if (0 <= expected && expected <= 25) {
StringTest::TestLowerOrdinal() {
for (int32_t i = 0;; ++i) {
char ic = nativeInvChars[i];
- uint8_t ac = asciiInvChars[i];
+ uint8_t ac = static_cast<uint8_t>(asciiInvChars[i]);
int32_t expected = ac - 'a';
int32_t actual = uprv_lowerOrdinal(ic);
if (0 <= expected && expected <= 25) {
Other other;
StringPiece piece(other);
- assertEquals("size()", piece.size(), other.size());
+ assertEquals("size()", piece.size(), static_cast<int32_t>(other.size()));
assertEquals("data()", piece.data(), other.data());
}