From: Andy Heninger Date: Fri, 30 Jan 2015 02:18:02 +0000 (+0000) Subject: ICU-11104 MSVC compiler warnings, apply patch from Chromium. X-Git-Tag: milestone-59-0-1~1306 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03fd84ff03a2c862c0285a3b7b7d173f445575ef;p=icu ICU-11104 MSVC compiler warnings, apply patch from Chromium. X-SVN-Rev: 36995 --- diff --git a/icu4c/source/i18n/decimfmt.cpp b/icu4c/source/i18n/decimfmt.cpp index f8df10abe99..a0ee233ccd5 100644 --- a/icu4c/source/i18n/decimfmt.cpp +++ b/icu4c/source/i18n/decimfmt.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1997-2014, International Business Machines Corporation and * +* Copyright (C) 1997-2015, International Business Machines Corporation and * * others. All Rights Reserved. * ******************************************************************************* * @@ -1434,7 +1434,7 @@ DecimalFormat::_format(int64_t number, // Slide the number to the start of the output str U_ASSERT(destIdx >= 0); int32_t length = MAX_IDX - destIdx -1; - /*int32_t prefixLen = */ appendAffix(appendTo, number, handler, number<0, TRUE); + /*int32_t prefixLen = */ appendAffix(appendTo, static_cast(number), handler, number<0, TRUE); int32_t maxIntDig = getMaximumIntegerDigits(); int32_t destlength = length<=maxIntDig?length:maxIntDig; // dest length pinned to max int digits @@ -1458,7 +1458,7 @@ DecimalFormat::_format(int64_t number, destlength); handler.addAttribute(kIntegerField, intBegin, appendTo.length()); - /*int32_t suffixLen =*/ appendAffix(appendTo, number, handler, number<0, FALSE); + /*int32_t suffixLen =*/ appendAffix(appendTo, static_cast(number), handler, number<0, FALSE); //outputStr[length]=0; diff --git a/icu4c/source/i18n/digitlst.cpp b/icu4c/source/i18n/digitlst.cpp index b0e60107c6b..51738bec027 100644 --- a/icu4c/source/i18n/digitlst.cpp +++ b/icu4c/source/i18n/digitlst.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** -* Copyright (C) 1997-2014, International Business Machines +* Copyright (C) 1997-2015, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * @@ -704,7 +704,7 @@ DigitList::set(int64_t source) U_ASSERT(uprv_strlen(str) < sizeof(str)); uprv_decNumberFromString(fDecNumber, str, &fContext); - internalSetDouble(source); + internalSetDouble(static_cast(source)); } /** diff --git a/icu4c/source/i18n/regexcmp.cpp b/icu4c/source/i18n/regexcmp.cpp index afed0f169e5..c3877a86aaa 100644 --- a/icu4c/source/i18n/regexcmp.cpp +++ b/icu4c/source/i18n/regexcmp.cpp @@ -1,7 +1,7 @@ // // file: regexcmp.cpp // -// Copyright (C) 2002-2014 International Business Machines Corporation and others. +// Copyright (C) 2002-2015 International Business Machines Corporation and others. // All Rights Reserved. // // This file contains the ICU regular expression compiler, which is responsible @@ -3478,7 +3478,7 @@ int32_t RegexCompile::maxMatchLength(int32_t start, int32_t end) { break; } - int32_t maxLoopCount = fRXPat->fCompiledPat->elementAti(loc+3); + int32_t maxLoopCount = static_cast(fRXPat->fCompiledPat->elementAti(loc+3)); if (maxLoopCount == -1) { // Unbounded Loop. No upper bound on match length. currentLen = INT32_MAX;