ICU-20351 A few more MSVC warning cleanups. (Mostly adding static_cast)
This commit is contained in:
parent
4711383bd8
commit
3ebd817504
@ -47,7 +47,7 @@ UBool FormattedValueFieldPositionIteratorImpl::nextPosition(
|
||||
UErrorCode&) const {
|
||||
U_ASSERT(fFields.size() % 4 == 0);
|
||||
int32_t numFields = fFields.size() / 4;
|
||||
int32_t i = cfpos.getInt64IterationContext();
|
||||
int32_t i = static_cast<int32_t>(cfpos.getInt64IterationContext());
|
||||
for (; i < numFields; i++) {
|
||||
UFieldCategory category = static_cast<UFieldCategory>(fFields.elementAti(i * 4));
|
||||
int32_t field = fFields.elementAti(i * 4 + 1);
|
||||
|
@ -2323,13 +2323,13 @@ static void TestParseCaseSensitive(void) {
|
||||
assertSuccess("Creating UNumberFormat", &status);
|
||||
double result = unum_parseDouble(fmt, u"1e2", -1, NULL, &status);
|
||||
assertSuccess("Parsing with UNumberFormat, case insensitive", &status);
|
||||
assertIntEquals("Result with case sensitive", 100, result);
|
||||
assertIntEquals("Result with case sensitive", 100, (int64_t)result);
|
||||
unum_setAttribute(fmt, UNUM_PARSE_CASE_SENSITIVE, 1);
|
||||
int32_t ppos = 0;
|
||||
result = unum_parseDouble(fmt, u"1e2", -1, &ppos, &status);
|
||||
assertSuccess("Parsing with UNumberFormat, case sensitive", &status);
|
||||
assertIntEquals("Position with case sensitive", 1, ppos);
|
||||
assertIntEquals("Result with case sensitive", 1, result);
|
||||
assertIntEquals("Result with case sensitive", 1, (int64_t)result);
|
||||
unum_close(fmt);
|
||||
}
|
||||
|
||||
|
@ -1500,7 +1500,7 @@ void LocaleBuilderTest::TestSetExtensionValidateOthersWellFormed() {
|
||||
};
|
||||
|
||||
const char * aToZ = "abcdefghijklmnopqrstuvwxyz";
|
||||
const int32_t aToZLen = uprv_strlen(aToZ);
|
||||
const int32_t aToZLen = static_cast<int32_t>(uprv_strlen(aToZ));
|
||||
int32_t i = 0;
|
||||
for (const char* extension : wellFormedExtensions) {
|
||||
char ch = aToZ[i];
|
||||
@ -1517,7 +1517,7 @@ void LocaleBuilderTest::TestSetExtensionValidateOthersWellFormed() {
|
||||
|
||||
const char* someChars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()-_=+;:,.<>?";
|
||||
const int32_t someCharsLen = uprv_strlen(someChars);
|
||||
const int32_t someCharsLen = static_cast<int32_t>(uprv_strlen(someChars));
|
||||
for (int32_t i = 0; i < someCharsLen; i++) {
|
||||
char ch = someChars[i];
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
@ -1553,7 +1553,7 @@ void LocaleBuilderTest::TestSetExtensionValidateOthersIllFormed() {
|
||||
"87654321-a-0-3", // First subtag too long
|
||||
};
|
||||
const char * aToZ = "abcdefghijklmnopqrstuvwxyz";
|
||||
const int32_t aToZLen = uprv_strlen(aToZ);
|
||||
const int32_t aToZLen = static_cast<int32_t>(uprv_strlen(aToZ));
|
||||
int32_t i = 0;
|
||||
for (const char* ill : illFormed) {
|
||||
char ch = aToZ[i];
|
||||
|
Loading…
Reference in New Issue
Block a user