Bug 1202568 - Cherry-pick warning fixes from upstream double-conversion. r=Ms2ger
authorChris Peterson <cpeterson@mozilla.com>
Sat, 05 Sep 2015 00:38:04 -0700
changeset 261937 0003682e05b93a1ce2f226665b848d25f12f3919
parent 261936 0f290d4c9fbb58e2ccd18063f7cd01a527621968
child 261938 5f612dcf8a0968ae7b282db4a458151dc28b36a0
push id15139
push usercbook@mozilla.com
push dateFri, 11 Sep 2015 14:42:20 +0000
treeherderfx-team@a5940e145cf8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs1202568
milestone43.0a1
Bug 1202568 - Cherry-pick warning fixes from upstream double-conversion. r=Ms2ger
mfbt/double-conversion/fix-aarch64-macro.patch
mfbt/double-conversion/fix-gcc-warnings.patch
mfbt/double-conversion/strtod.cc
mfbt/double-conversion/update.sh
mfbt/double-conversion/utils.h
deleted file mode 100644
--- a/mfbt/double-conversion/fix-aarch64-macro.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Backport from upstream.
-
-https://code.google.com/p/double-conversion/source/detail?r=4e24bb31bcc76d6d218f3056b4c24a109d367561
-
----
- mfbt/double-conversion/utils.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
-@@ -58,11 +58,11 @@
-     defined(__mips__) || \
-     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
-     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
-     defined(__SH4__) || defined(__alpha__) || \
-     defined(_MIPS_ARCH_MIPS32R2) || \
--    defined(_AARCH64EL_)
-+    defined(__AARCH64EL__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
- #if defined(_WIN32)
- // Windows uses a 64bit wide floating point stack.
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
deleted file mode 100644
--- a/mfbt/double-conversion/fix-gcc-warnings.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/a/mfbt/double-conversion/strtod.cc b/inbound/mfbt/double-conversion/strtod.cc
-index 9758989..97fa4a5 100644
---- a/a/mfbt/double-conversion/strtod.cc
-+++ b/inbound/mfbt/double-conversion/strtod.cc
-@@ -501,17 +501,19 @@ float Strtof(Vector<const char> buffer, int exponent) {
-   // if they would round to the same float. If the guess is not correct we have
-   // to look at four values (since two different doubles could be the correct
-   // double).
- 
-   double double_next = Double(double_guess).NextDouble();
-   double double_previous = Double(double_guess).PreviousDouble();
- 
-   float f1 = static_cast<float>(double_previous);
-+#if defined(DEBUG)
-   float f2 = float_guess;
-+#endif
-   float f3 = static_cast<float>(double_next);
-   float f4;
-   if (is_correct) {
-     f4 = f3;
-   } else {
-     double double_next2 = Double(double_next).NextDouble();
-     f4 = static_cast<float>(double_next2);
-   }
--- a/mfbt/double-conversion/strtod.cc
+++ b/mfbt/double-conversion/strtod.cc
@@ -501,27 +501,26 @@ float Strtof(Vector<const char> buffer, 
   // if they would round to the same float. If the guess is not correct we have
   // to look at four values (since two different doubles could be the correct
   // double).
 
   double double_next = Double(double_guess).NextDouble();
   double double_previous = Double(double_guess).PreviousDouble();
 
   float f1 = static_cast<float>(double_previous);
-#if defined(DEBUG)
   float f2 = float_guess;
-#endif
   float f3 = static_cast<float>(double_next);
   float f4;
   if (is_correct) {
     f4 = f3;
   } else {
     double double_next2 = Double(double_next).NextDouble();
     f4 = static_cast<float>(double_next2);
   }
+  (void) f2; // Mark variable as used.
   ASSERT(f1 <= f2 && f2 <= f3 && f3 <= f4);
 
   // If the guess doesn't lie near a single-precision boundary we can simply
   // return its float-value.
   if (f1 == f4) {
     return float_guess;
   }
 
--- a/mfbt/double-conversion/update.sh
+++ b/mfbt/double-conversion/update.sh
@@ -16,12 +16,8 @@ cp $1/src/*.h ./
 # Source
 cp $1/src/*.cc ./
 
 patch -p3 < add-mfbt-api-markers.patch
 patch -p3 < use-StandardInteger.patch
 patch -p3 < use-mozilla-assertions.patch
 patch -p3 < use-static_assert.patch
 patch -p3 < ToPrecision-exponential.patch
-patch -p3 < fix-gcc-warnings.patch
-
-# Merged upstream, part of 2.0.1 version
-patch -p3 < fix-aarch64-macro.patch
--- a/mfbt/double-conversion/utils.h
+++ b/mfbt/double-conversion/utils.h
@@ -55,17 +55,17 @@
 #if defined(_M_X64) || defined(__x86_64__) || \
     defined(__ARMEL__) || defined(__avr32__) || \
     defined(__hppa__) || defined(__ia64__) || \
     defined(__mips__) || \
     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
     defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
     defined(__SH4__) || defined(__alpha__) || \
     defined(_MIPS_ARCH_MIPS32R2) || \
-    defined(__AARCH64EL__)
+    defined(__AARCH64EL__) || defined(__aarch64__)
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #if defined(_WIN32)
 // Windows uses a 64bit wide floating point stack.
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
 #else
 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
 #endif  // _WIN32
@@ -136,18 +136,18 @@ inline int StrLength(const char* string)
   return static_cast<int>(length);
 }
 
 // This is a simplified version of V8's Vector class.
 template <typename T>
 class Vector {
  public:
   Vector() : start_(NULL), length_(0) {}
-  Vector(T* data, int length) : start_(data), length_(length) {
-    ASSERT(length == 0 || (length > 0 && data != NULL));
+  Vector(T* data, int len) : start_(data), length_(len) {
+    ASSERT(len == 0 || (len > 0 && data != NULL));
   }
 
   // Returns a vector using the same backing storage as this one,
   // spanning from and including 'from', to but not including 'to'.
   Vector<T> SubVector(int from, int to) {
     ASSERT(to <= length_);
     ASSERT(from < to);
     ASSERT(0 <= from);
@@ -179,18 +179,18 @@ class Vector {
 };
 
 
 // Helper class for building result strings in a character buffer. The
 // purpose of the class is to use safe operations that checks the
 // buffer bounds on all operations in debug mode.
 class StringBuilder {
  public:
-  StringBuilder(char* buffer, int size)
-      : buffer_(buffer, size), position_(0) { }
+  StringBuilder(char* buffer, int buffer_size)
+      : buffer_(buffer, buffer_size), position_(0) { }
 
   ~StringBuilder() { if (!is_finalized()) Finalize(); }
 
   int size() const { return buffer_.length(); }
 
   // Get the current position in the builder.
   int position() const {
     ASSERT(!is_finalized());