ICU-13275 Merge some safe warning fixes to the trunk

X-SVN-Rev: 40322
This commit is contained in:
William Zhao 2017-08-08 19:51:54 +00:00
parent fdd5212284
commit 00586e9f97
2 changed files with 6 additions and 6 deletions

View File

@ -226,7 +226,7 @@ AffixPattern::append(const AffixPattern &other) {
addLiteral(literal.getBuffer(), 0, literal.length());
break;
case kCurrency:
addCurrency(iter.getTokenLength());
addCurrency(static_cast<uint8_t>(iter.getTokenLength()));
break;
default:
add(iter.getTokenType());
@ -481,7 +481,7 @@ AffixPattern::parseUserAffixString(
break;
case 0xA4:
appender.flush();
appendTo.add(kCurrency, tokenSize);
appendTo.add(kCurrency, static_cast<uint8_t>(tokenSize));
break;
default:
appender.append(token);

View File

@ -2430,7 +2430,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re
isPrevQuote = TRUE;
if (itemType != GMTOffsetField::TEXT) {
if (GMTOffsetField::isValid(itemType, itemLength)) {
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, (uint8_t)itemLength, status);
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast<uint8_t>(itemLength), status);
result->addElement(fld, status);
if (U_FAILURE(status)) {
break;
@ -2465,7 +2465,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re
}
} else {
if (GMTOffsetField::isValid(itemType, itemLength)) {
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status);
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast<uint8_t>(itemLength), status);
result->addElement(fld, status);
if (U_FAILURE(status)) {
break;
@ -2483,7 +2483,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re
// a string literal
if (itemType != GMTOffsetField::TEXT) {
if (GMTOffsetField::isValid(itemType, itemLength)) {
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status);
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast<uint8_t>(itemLength), status);
result->addElement(fld, status);
if (U_FAILURE(status)) {
break;
@ -2508,7 +2508,7 @@ TimeZoneFormat::parseOffsetPattern(const UnicodeString& pattern, OffsetFields re
}
} else {
if (GMTOffsetField::isValid(itemType, itemLength)) {
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, itemLength, status);
GMTOffsetField* fld = GMTOffsetField::createTimeField(itemType, static_cast<uint8_t>(itemLength), status);
result->addElement(fld, status);
} else {
status = U_ILLEGAL_ARGUMENT_ERROR;