]> granicus.if.org Git - icu/commitdiff
ICU-13725 Assorted minor changes to number formatting code for MSVC compatibility
authorShane Carr <shane@unicode.org>
Tue, 24 Apr 2018 22:24:11 +0000 (22:24 +0000)
committerShane Carr <shane@unicode.org>
Tue, 24 Apr 2018 22:24:11 +0000 (22:24 +0000)
X-SVN-Rev: 41271

icu4c/source/common/numparse_unisets.h
icu4c/source/i18n/decimfmt.cpp
icu4c/source/test/cintltst/unumberformattertst.c
icu4c/source/test/intltest/numbertest_decimalquantity.cpp
icu4c/source/test/intltest/numrgts.cpp

index e6a51e149211eb7d2a2dab828f769abf40dfad8b..f02e9f5436b9431ef1709270dfcf6d0bfad81492 100644 (file)
@@ -61,7 +61,8 @@ enum Key {
     COUNT
 };
 
-const UnicodeSet* get(Key key);
+// Exported as U_COMMON_API for ucurr.h
+const U_COMMON_API UnicodeSet* get(Key key);
 
 Key chooseFrom(UnicodeString str, Key key1);
 
index b18da05075ea506e7fbd7fff0fc7c0a8630be3f4..dd2743441259bbc8ad18b4d6836c53369fbd5b8e 100644 (file)
@@ -1305,7 +1305,7 @@ bool DecimalFormat::fastFormatInt64(int64_t input, UnicodeString& output) const
     if (i32 != input || i32 == INT32_MIN) {
         return false;
     }
-    doFastFormatInt32(i32, std::signbit(input), output);
+    doFastFormatInt32(i32, input < 0, output);
     return true;
 }
 
index c7abb232000c23c7eff978b60fd3ebf6bbdabad1..b968f43842b87fdd1321338da0195a8b5bb90c82 100644 (file)
@@ -30,9 +30,10 @@ void addUNumberFormatterTest(TestNode** root) {
 }
 
 
+#define CAPACITY 30
+
 static void TestSkeletonFormatToString() {
     UErrorCode ec = U_ZERO_ERROR;
-    static const int32_t CAPACITY = 30;
     UChar buffer[CAPACITY];
 
     // setup:
index e8aaffa193b9ecc5a7310677257c24377fb73d78..4fdd8ab85b17efaa979be2c1d21b794cdc380ba6 100644 (file)
@@ -366,7 +366,7 @@ void DecimalQuantityTest::testMaxDigits() {
     dq.setFractionLength(0, 2);
     assertEquals("Should trim, toPlainString", "76.54", dq.toPlainString());
     assertEquals("Should trim, toScientificString", "7.654E+1", dq.toScientificString());
-    assertEquals("Should trim, toLong", 76L, dq.toLong(true));
+    assertEquals("Should trim, toLong", 76LL, dq.toLong(true));
     assertEquals("Should trim, toFractionLong", 54L, dq.toFractionLong(false));
     assertEquals("Should trim, toDouble", 76.54, dq.toDouble());
     // To test DecNum output, check the round-trip.
index 56e85120e6d99e0f0ba0b1a0a4ce3d99b53169bf..2c2ebbb3fd59fab6cec1a7e1dc7fba3b98bfd7b8 100644 (file)
@@ -2770,7 +2770,7 @@ void NumberFormatRegressionTest::Test8199(void) {
     nf->parse(numStr, val, status);
     TEST_CHECK_STATUS(status);
     TEST_ASSERT_EQUALS(Formattable::kDouble, val.getType());
-    TEST_ASSERT_EQUALS(1000000000L, val.getInt64(status));
+    TEST_ASSERT_EQUALS(1000000000LL, val.getInt64(status));
     TEST_CHECK_STATUS(status);
     TEST_ASSERT_EQUALS(1000000000.6, val.getDouble(status));
     TEST_CHECK_STATUS(status);