]> granicus.if.org Git - icu/commitdiff
ICU-10379 fixes for IBM i - ambiguous types
authorSteven R. Loomis <srl@icu-project.org>
Thu, 12 Sep 2013 06:29:39 +0000 (06:29 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Thu, 12 Sep 2013 06:29:39 +0000 (06:29 +0000)
X-SVN-Rev: 34285

icu4c/source/i18n/decimfmt.cpp
icu4c/source/test/intltest/plurfmts.cpp
icu4c/source/test/intltest/tmsgfmt.cpp

index 983eb47279022bc34ca50e7280a432dce7c797a0..8b7afd0caa699a676485c5a8e6e0672ece05e8f3 100644 (file)
@@ -1551,7 +1551,7 @@ DecimalFormat::_round(const DigitList &number, DigitList &adjustedNum, UBool& is
 
     if (fScale != 0) {
         DigitList ten;
-        ten.set(10);
+        ten.set((int32_t)10);
         if (fScale > 0) {
             for (int32_t i = fScale ; i > 0 ; i--) {
                 adjustedNum.mult(ten, status);
@@ -2196,7 +2196,7 @@ void DecimalFormat::parse(const UnicodeString& text,
 
         if (fScale != 0) {
             DigitList ten;
-            ten.set(10);
+            ten.set((int32_t)10);
             if (fScale > 0) {
                 for (int32_t i = fScale; i > 0; i--) {
                     UErrorCode ec = U_ZERO_ERROR;
index c3bc5cebb952b222e32322be4412b4f64f8592a8..3b3f59cee1c0243f5522a6e3d85f12e90c153cbe 100644 (file)
@@ -670,14 +670,14 @@ PluralFormatTest::TestDecimals() {
     IcuTestErrorCode errorCode(*this, "TestDecimals");
     // Simple number replacement.
     PluralFormat pf(Locale::getEnglish(), "one{one meter}other{# meters}", errorCode);
-    assertEquals("simple format(1)", "one meter", pf.format(1, errorCode));
+    assertEquals("simple format(1)", "one meter", pf.format((int32_t)1, errorCode));
     assertEquals("simple format(1.5)", "1.5 meters", pf.format(1.5, errorCode));
     PluralFormat pf2(Locale::getEnglish(),
             "offset:1 one{another meter}other{another # meters}", errorCode);
     DecimalFormat df("0.0", new DecimalFormatSymbols(Locale::getEnglish(), errorCode), errorCode);
     pf2.setNumberFormat(&df, errorCode);
-    assertEquals("offset-decimals format(1)", "another 0.0 meters", pf2.format(1, errorCode));
-    assertEquals("offset-decimals format(2)", "another 1.0 meters", pf2.format(2, errorCode));
+    assertEquals("offset-decimals format(1)", "another 0.0 meters", pf2.format((int32_t)1, errorCode));
+    assertEquals("offset-decimals format(2)", "another 1.0 meters", pf2.format((int32_t)2, errorCode));
     assertEquals("offset-decimals format(2.5)", "another 1.5 meters", pf2.format(2.5, errorCode));
 }
 
index bcaabe378770749749a17c40a48095acc12fe131..cf375eca67d70ec0fd192733001aab38cc937109 100644 (file)
@@ -1905,7 +1905,7 @@ void TestMessageFormat::TestDecimals() {
     assertEquals("simple format(1)", "one meter",
             m.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 1.5;
+    args[0] = (double)1.5;
     result.remove();
     assertEquals("simple format(1.5)", "1.5 meters",
             m.format(args, 1, result, ignore, errorCode));
@@ -1914,12 +1914,12 @@ void TestMessageFormat::TestDecimals() {
     MessageFormat m0(
             "{0,plural,one{one meter}other{{0} meters}}",
             Locale::getEnglish(), errorCode);
-    args[0] = 1;
+    args[0] = (int32_t)1;
     result.remove();
     assertEquals("explicit format(1)", "one meter",
             m0.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 1.5;
+    args[0] = (double)1.5;
     result.remove();
     assertEquals("explicit format(1.5)", "1.5 meters",
             m0.format(args, 1, result, ignore, errorCode));
@@ -1928,17 +1928,17 @@ void TestMessageFormat::TestDecimals() {
     MessageFormat m1(
             "{0,plural,offset:1 one{another meter}other{{0,number,00.#} meters}}",
             Locale::getEnglish(), errorCode);
-    args[0] = 1;
+    args[0] = (int32_t)1;
     result.remove();
     assertEquals("offset format(1)", "01 meters",
             m1.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 2;
+    args[0] = (int32_t)2;
     result.remove();
     assertEquals("offset format(1)", "another meter",
             m1.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 2.5;
+    args[0] = (double)2.5;
     result.remove();
     assertEquals("offset format(1)", "02.5 meters",
             m1.format(args, 1, result, ignore, errorCode));
@@ -1947,17 +1947,17 @@ void TestMessageFormat::TestDecimals() {
     MessageFormat m2(
             "{0,plural,offset:1 one{another meter}other{{0,number,0.0} meters}}",
             Locale::getEnglish(), errorCode);
-    args[0] = 1;
+    args[0] = (int32_t)1;
     result.remove();
     assertEquals("offset-decimals format(1)", "1.0 meters",
             m2.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 2;
+    args[0] = (int32_t)2;
     result.remove();
     assertEquals("offset-decimals format(1)", "2.0 meters",
             m2.format(args, 1, result, ignore, errorCode));
 
-    args[0] = 2.5;
+    args[0] = (double)2.5;
     result.remove();
     assertEquals("offset-decimals format(1)", "2.5 meters",
             m2.format(args, 1, result, ignore, errorCode));