From 00586e9f97f0adb09afea2e1ef1cee555904e02d Mon Sep 17 00:00:00 2001 From: William Zhao <39807811+mingyzha@users.noreply.github.com> Date: Tue, 8 Aug 2017 19:51:54 +0000 Subject: [PATCH] ICU-13275 Merge some safe warning fixes to the trunk X-SVN-Rev: 40322 --- icu4c/source/i18n/affixpatternparser.cpp | 4 ++-- icu4c/source/i18n/tzfmt.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/icu4c/source/i18n/affixpatternparser.cpp b/icu4c/source/i18n/affixpatternparser.cpp index 75a4decb31..c15f3871f3 100644 --- a/icu4c/source/i18n/affixpatternparser.cpp +++ b/icu4c/source/i18n/affixpatternparser.cpp @@ -226,7 +226,7 @@ AffixPattern::append(const AffixPattern &other) { addLiteral(literal.getBuffer(), 0, literal.length()); break; case kCurrency: - addCurrency(iter.getTokenLength()); + addCurrency(static_cast(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(tokenSize)); break; default: appender.append(token); diff --git a/icu4c/source/i18n/tzfmt.cpp b/icu4c/source/i18n/tzfmt.cpp index 383fb51483..50277c24ef 100644 --- a/icu4c/source/i18n/tzfmt.cpp +++ b/icu4c/source/i18n/tzfmt.cpp @@ -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(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(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(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(itemLength), status); result->addElement(fld, status); } else { status = U_ILLEGAL_ARGUMENT_ERROR;