]> granicus.if.org Git - icu/commitdiff
ICU-21546 Fix warnings from running the samples with MSVC.
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Mon, 5 Apr 2021 19:12:18 +0000 (12:12 -0700)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Mon, 5 Apr 2021 20:59:43 +0000 (13:59 -0700)
icu4c/source/common/locid.cpp
icu4c/source/common/uloc_tag.cpp
icu4c/source/test/intltest/tzfmttst.cpp

index e16fbb724a4be8884b8a9a694f09a8e46df091e4..b79ba40ae7ccdc3e26d9538fbf3a2fd4298a16d5 100644 (file)
@@ -1541,7 +1541,7 @@ AliasReplacer::replaceTransformedExtensions(
     const char* str = transformedExtensions.data();
     const char* tkey = ultag_getTKeyStart(str);
     int32_t tlangLen = (tkey == str) ? 0 :
-        ((tkey == nullptr) ? len : (tkey - str - 1));
+        ((tkey == nullptr) ? len : static_cast<int32_t>((tkey - str - 1)));
     CharStringByteSink sink(&output);
     if (tlangLen > 0) {
         Locale tlang = LocaleBuilder()
index 0bd4b85e2c01787b4a4901ef03dd32f601155fac..1235081bf39ffc1ed40c519468b09202d5e91a75 100644 (file)
@@ -651,7 +651,7 @@ ultag_getTKeyStart(const char *localeID) {
     const char *result = localeID;
     const char *sep;
     while((sep = uprv_strchr(result, SEP)) != nullptr) {
-        if (_isTKey(result, sep - result)) {
+        if (_isTKey(result, static_cast<int32_t>(sep - result))) {
             return result;
         }
         result = ++sep;
index 0f58a0003a5697b41706956b57f8d5c4636aa3e1..882125f1c3fe42705aeccdebf9530803aacc70ab 100644 (file)
@@ -745,9 +745,9 @@ void TimeZoneFormatTest::RunAdoptDefaultThreadSafeTests(int32_t threadNumber) {
             date += 6000 * i;
             std::unique_ptr<icu::TimeZone> tz(icu::TimeZone::createDefault());
             status = U_ZERO_ERROR;
-            tz->getOffset(date, TRUE, rawOffset, dstOffset, status);
+            tz->getOffset(static_cast<UDate>(date), TRUE, rawOffset, dstOffset, status);
             status = U_ZERO_ERROR;
-            tz->getOffset(date, FALSE, rawOffset, dstOffset, status);
+            tz->getOffset(static_cast<UDate>(date), FALSE, rawOffset, dstOffset, status);
         }
     }
 }