Bug 1202568 - Cherry-pick warning fixes from upstream double-conversion. r=Ms2ger

--HG--
extra : rebase_source : 732eec4f5748b54e42a23267b2023b303f213983
This commit is contained in:
Chris Peterson 2015-09-05 00:38:04 -07:00
parent 06366cd453
commit a037228e4f
5 changed files with 6 additions and 58 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -506,9 +506,7 @@ float Strtof(Vector<const char> buffer, int exponent) {
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) {
@ -517,6 +515,7 @@ float Strtof(Vector<const char> buffer, int exponent) {
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

View File

@ -21,7 +21,3 @@ 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

View File

@ -60,7 +60,7 @@
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)
@ -141,8 +141,8 @@ 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,
@ -184,8 +184,8 @@ class Vector {
// 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(); }