ICU-20979 Fixing minor MSVC warnings
This commit is contained in:
parent
eb9f1c82cf
commit
822eb4e622
@ -722,7 +722,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
|
||||
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) {
|
||||
|
@ -193,7 +193,7 @@ _processRFC3066Locale(CollatorSpec *spec, uint32_t, const char* string,
|
||||
*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;
|
||||
}
|
||||
}
|
||||
|
@ -1639,8 +1639,9 @@ std::string RBBIMonkeyKind::classNameFromCodepoint(const UChar32 c) {
|
||||
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;
|
||||
|
@ -166,7 +166,7 @@ void
|
||||
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) {
|
||||
@ -188,7 +188,7 @@ void
|
||||
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) {
|
||||
@ -506,7 +506,7 @@ StringTest::TestStringPieceOther() {
|
||||
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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user