]> granicus.if.org Git - icu/commitdiff
ICU-20438 Adding additional ICU patches to double-conversion.
authorShane Carr <shane@unicode.org>
Wed, 27 Feb 2019 01:23:42 +0000 (17:23 -0800)
committerShane F. Carr <shane@unicode.org>
Wed, 27 Feb 2019 02:53:26 +0000 (20:53 -0600)
icu4c/source/i18n/double-conversion.cpp
icu4c/source/i18n/double-conversion.h
vendor/double-conversion/UPDATING.md

index 66252341f109d51563cfd4970fed469ae3c100cb..f4b33e8c4ef51f519ec7908252a0e1c6ece48b73 100644 (file)
 #include "unicode/utypes.h"
 #if !UCONFIG_NO_FORMATTING
 
+// ICU PATCH: Do not include std::locale.
+
 #include <climits>
-#include <locale>
+//#include <locale>
 #include <cmath>
 
 // ICU PATCH: Customize header file paths for ICU.
@@ -436,9 +438,14 @@ void DoubleToStringConverter::DoubleToAscii(double v,
 namespace {
 
 inline char ToLower(char ch) {
+#if 0  // do not include std::locale in ICU
   static const std::ctype<char>& cType =
       std::use_facet<std::ctype<char> >(std::locale::classic());
   return cType.tolower(ch);
+#else
+  (void)ch;
+  UNREACHABLE();
+#endif
 }
 
 inline char Pass(char ch) {
index 377c710bf791e7aff730f0abcd11cfaa2dd8a0c9..1857615141a4518f18517d353bfeb80b1cb7ef5e 100644 (file)
@@ -544,7 +544,9 @@ class StringToDoubleConverter {
         junk_string_value_(junk_string_value),
         infinity_symbol_(infinity_symbol),
         nan_symbol_(nan_symbol),
-        separator_(separator) {
+        // ICU PATCH: Convert the u16 to a char.
+        // This patch should be removed when upstream #89 is fixed.
+        separator_(static_cast<char>(separator)) {
   }
 
   // Performs the conversion.
@@ -579,7 +581,10 @@ class StringToDoubleConverter {
   const double junk_string_value_;
   const char* const infinity_symbol_;
   const char* const nan_symbol_;
-  const uc16 separator_;
+
+  // ICU PATCH: Avoid warnings by making this a char instead of a u16.
+  // This patch should be removed when upstream #89 is fixed.
+  const char separator_;
 
   template <class Iterator>
   double StringToIeee(Iterator start_pointer,
index 932150a42cfe614cd15aa1122117de3fb465da75..2a89377b8b8bff8dc2220d6f003e98c8e967666c 100644 (file)
@@ -19,6 +19,10 @@ After completing the first step, the script will stop again and ask you whether
 
 Make note of the output of the command. If there are any merge conflicts, you will need to resolve them manually.
 
+## Checking ICU Patches
+
+Look over any ICU patches in the icu4c/i18n version of the code files; they should be marked clearly with "ICU PATCH" comments.  Make sure that the patches are still needed and remove them if possible.
+
 ## Next Steps
 
 Build and test icu4c, and send the PR for review.