Bug 1446592 - Update our local double_conversion to tip. Also remove one local patch as unnecessary as of MSVC 2010, hacking around prior versions' lack of <stdint.h> support. r=froydnj
authorJeff Walden <jwalden@mit.edu>
Fri, 16 Mar 2018 20:25:17 -0700
changeset 409133 f8ea3e37c3ef7d3a5345ec2152ba671f66f39010
parent 409132 faa9d965f89eca4a2fe8727149e6fa8d7a699604
child 409134 b920e738851417d8d3a191667d68294adc1624bb
push id33676
push usertoros@mozilla.com
push dateWed, 21 Mar 2018 10:03:44 +0000
treeherdermozilla-central@e636edf00e6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1446592
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446592 - Update our local double_conversion to tip. Also remove one local patch as unnecessary as of MSVC 2010, hacking around prior versions' lack of <stdint.h> support. r=froydnj
media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
media/webrtc/signaling/src/media-conduit/VideoConduit.h
mfbt/double-conversion/GIT-INFO
mfbt/double-conversion/add-mfbt-api-markers.patch
mfbt/double-conversion/double-conversion/bignum.h
mfbt/double-conversion/double-conversion/double-conversion.h
mfbt/double-conversion/double-conversion/ieee.h
mfbt/double-conversion/double-conversion/strtod.cc
mfbt/double-conversion/double-conversion/utils.h
mfbt/double-conversion/update.sh
mfbt/double-conversion/use-StandardInteger.patch
--- a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
+++ b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h
@@ -6,17 +6,16 @@
 #define MEDIA_CONDUIT_ABSTRACTION_
 
 #include "nsISupportsImpl.h"
 #include "nsXPCOM.h"
 #include "nsDOMNavigationTiming.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/RefCounted.h"
 #include "mozilla/UniquePtr.h"
-#include "double-conversion/utils.h" // for DISALLOW_COPY_AND_ASSIGN
 #include "RtpSourceObserver.h"
 #include "CodecConfig.h"
 #include "VideoTypes.h"
 #include "MediaConduitErrors.h"
 
 #include "ImageContainer.h"
 
 #include "webrtc/call.h"
@@ -85,17 +84,20 @@ private:
   }
 
   explicit WebRtcCallWrapper(UniquePtr<webrtc::Call>&& aCall)
   {
     MOZ_ASSERT(aCall);
     mCall = std::move(aCall);
   }
 
-  DISALLOW_COPY_AND_ASSIGN(WebRtcCallWrapper);
+  // Don't allow copying/assigning.
+  WebRtcCallWrapper(const WebRtcCallWrapper&) = delete;
+  void operator=(const WebRtcCallWrapper&) = delete;
+
   UniquePtr<webrtc::Call> mCall;
   webrtc::RtcEventLogNullImpl mEventLog;
 };
 
 
 /**
  * Abstract Interface for transporting RTP packets - audio/vidoeo
  * The consumers of this interface are responsible for passing in
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.h
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.h
@@ -306,17 +306,19 @@ public:
                              uint32_t* cumulativeLost,
                              int32_t* rttMs) override;
   bool GetRTCPSenderReport(DOMHighResTimeStamp* timestamp,
                            unsigned int* packetsSent,
                            uint64_t* bytesSent) override;
   uint64_t MozVideoLatencyAvg();
 
 private:
-  DISALLOW_COPY_AND_ASSIGN(WebrtcVideoConduit);
+  // Don't allow copying/assigning.
+  WebrtcVideoConduit(const WebrtcVideoConduit&) = delete;
+  void operator=(const WebrtcVideoConduit&) = delete;
 
   /** Shared statistics for receive and transmit video streams
    */
   class StreamStatistics {
   public:
     void Update(const double aFrameRate, const double aBitrate);
     /**
      * Returns gathered stream statistics
--- a/mfbt/double-conversion/GIT-INFO
+++ b/mfbt/double-conversion/GIT-INFO
@@ -1,9 +1,37 @@
-commit fe9b384793c4e79bd32133dc9053f27b75a5eeae
-Merge: 2a257b7 1d5a688
-Author: Florian Loitsch <floitsch@google.com>
-Date:   Fri Sep 15 11:32:00 2017 +0200
+commit 1b5fa314800a0e68e2b5d00d17e87a5b1fa3ac5d
+Author: Shane <sffc@sffc1.com>
+Date:   Fri Mar 2 01:26:53 2018 -0800
+
+    Clarify output charset in DoubleToAscii documentation (#61)
+    
+    * Clarify output charset in DoubleToAscii documentation
+    
+    * Fixing typo in charset docs.
 
-    Merge pull request #52 from uburuntu/master
-    
-    Some refactorings: remove unused static, replace deprecated headers, init member in constructor
-
+diff --git a/double-conversion/double-conversion.h b/double-conversion/double-conversion.h
+index 9978bde..1ccd7fc 100644
+--- a/double-conversion/double-conversion.h
++++ b/double-conversion/double-conversion.h
+@@ -294,13 +294,18 @@ class DoubleToStringConverter {
+   // should be at least kBase10MaximalLength + 1 characters long.
+   static const int kBase10MaximalLength = 17;
+ 
+-  // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or
+-  // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v'
+-  // after it has been casted to a single-precision float. That is, in this
+-  // mode static_cast<float>(v) must not be NaN, +Infinity or -Infinity.
++  // Converts the given double 'v' to digit characters. 'v' must not be NaN,
++  // +Infinity, or -Infinity. In SHORTEST_SINGLE-mode this restriction also
++  // applies to 'v' after it has been casted to a single-precision float. That
++  // is, in this mode static_cast<float>(v) must not be NaN, +Infinity or
++  // -Infinity.
+   //
+   // The result should be interpreted as buffer * 10^(point-length).
+   //
++  // The digits are written to the buffer in the platform's charset, which is
++  // often UTF-8 (with ASCII-range digits) but may be another charset, such
++  // as EBCDIC.
++  //
+   // The output depends on the given mode:
+   //  - SHORTEST: produce the least amount of digits for which the internal
+   //   identity requirement is still satisfied. If the digits are printed
--- a/mfbt/double-conversion/add-mfbt-api-markers.patch
+++ b/mfbt/double-conversion/add-mfbt-api-markers.patch
@@ -102,24 +102,24 @@ diff --git a/mfbt/double-conversion/doub
    // A higher precision can be achieved by using more digits, but the shortest
    // accurate representation of any double will never use more digits than
    // kBase10MaximalLength.
    // Note that DoubleToAscii null-terminates its input. So the given buffer
    // should be at least kBase10MaximalLength + 1 characters long.
 -  static const int kBase10MaximalLength = 17;
 +  static const MFBT_DATA int kBase10MaximalLength = 17;
  
-   // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or
-   // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v'
-   // after it has been casted to a single-precision float. That is, in this
-   // mode static_cast<float>(v) must not be NaN, +Infinity or -Infinity.
+   // Converts the given double 'v' to digit characters. 'v' must not be NaN,
+   // +Infinity, or -Infinity. In SHORTEST_SINGLE-mode this restriction also
+   // applies to 'v' after it has been casted to a single-precision float. That
+   // is, in this mode static_cast<float>(v) must not be NaN, +Infinity or
+   // -Infinity.
    //
    // The result should be interpreted as buffer * 10^(point-length).
-   //
-@@ -327,44 +328,44 @@ class DoubleToStringConverter {
+@@ -332,44 +333,44 @@ class DoubleToStringConverter {
    // DoubleToAscii expects the given buffer to be big enough to hold all
    // digits and a terminating null-character. In SHORTEST-mode it expects a
    // buffer of at least kBase10MaximalLength + 1. In all other modes the
    // requested_digits parameter and the padding-zeroes limit the size of the
    // output. Don't forget the decimal point, the exponent character and the
    // terminating null-character when computing the maximal output size.
    // The given length is only used in debug mode to ensure the buffer is big
    // enough.
--- a/mfbt/double-conversion/double-conversion/bignum.h
+++ b/mfbt/double-conversion/double-conversion/bignum.h
@@ -131,14 +131,14 @@ class Bignum {
   Chunk bigits_buffer_[kBigitCapacity];
   // A vector backed by bigits_buffer_. This way accesses to the array are
   // checked for out-of-bounds errors.
   Vector<Chunk> bigits_;
   int used_digits_;
   // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize).
   int exponent_;
 
-  DISALLOW_COPY_AND_ASSIGN(Bignum);
+  DC_DISALLOW_COPY_AND_ASSIGN(Bignum);
 };
 
 }  // namespace double_conversion
 
 #endif  // DOUBLE_CONVERSION_BIGNUM_H_
--- a/mfbt/double-conversion/double-conversion/double-conversion.h
+++ b/mfbt/double-conversion/double-conversion/double-conversion.h
@@ -291,23 +291,28 @@ class DoubleToStringConverter {
   // The maximal number of digits that are needed to emit a double in base 10.
   // A higher precision can be achieved by using more digits, but the shortest
   // accurate representation of any double will never use more digits than
   // kBase10MaximalLength.
   // Note that DoubleToAscii null-terminates its input. So the given buffer
   // should be at least kBase10MaximalLength + 1 characters long.
   static const MFBT_DATA int kBase10MaximalLength = 17;
 
-  // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or
-  // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v'
-  // after it has been casted to a single-precision float. That is, in this
-  // mode static_cast<float>(v) must not be NaN, +Infinity or -Infinity.
+  // Converts the given double 'v' to digit characters. 'v' must not be NaN,
+  // +Infinity, or -Infinity. In SHORTEST_SINGLE-mode this restriction also
+  // applies to 'v' after it has been casted to a single-precision float. That
+  // is, in this mode static_cast<float>(v) must not be NaN, +Infinity or
+  // -Infinity.
   //
   // The result should be interpreted as buffer * 10^(point-length).
   //
+  // The digits are written to the buffer in the platform's charset, which is
+  // often UTF-8 (with ASCII-range digits) but may be another charset, such
+  // as EBCDIC.
+  //
   // The output depends on the given mode:
   //  - SHORTEST: produce the least amount of digits for which the internal
   //   identity requirement is still satisfied. If the digits are printed
   //   (together with the correct exponent) then reading this number will give
   //   'v' again. The buffer will choose the representation that is closest to
   //   'v'. If there are two at the same distance, than the one farther away
   //   from 0 is chosen (halfway cases - ending with 5 - are rounded up).
   //   In this mode the 'requested_digits' parameter is ignored.
@@ -371,17 +376,17 @@ class DoubleToStringConverter {
   const char* const infinity_symbol_;
   const char* const nan_symbol_;
   const char exponent_character_;
   const int decimal_in_shortest_low_;
   const int decimal_in_shortest_high_;
   const int max_leading_padding_zeroes_in_precision_mode_;
   const int max_trailing_padding_zeroes_in_precision_mode_;
 
-  DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter);
+  DC_DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter);
 };
 
 
 class StringToDoubleConverter {
  public:
   // Enumeration for allowing octals and ignoring junk when converting
   // strings to numbers.
   enum Flags {
@@ -535,14 +540,14 @@ class StringToDoubleConverter {
   const char* const nan_symbol_;
 
   template <class Iterator>
   double StringToIeee(Iterator start_pointer,
                       int length,
                       bool read_as_double,
                       int* processed_characters_count) const;
 
-  DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter);
+  DC_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter);
 };
 
 }  // namespace double_conversion
 
 #endif  // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
--- a/mfbt/double-conversion/double-conversion/ieee.h
+++ b/mfbt/double-conversion/double-conversion/ieee.h
@@ -252,17 +252,17 @@ class Double {
       biased_exponent = 0;
     } else {
       biased_exponent = static_cast<uint64_t>(exponent + kExponentBias);
     }
     return (significand & kSignificandMask) |
         (biased_exponent << kPhysicalSignificandSize);
   }
 
-  DISALLOW_COPY_AND_ASSIGN(Double);
+  DC_DISALLOW_COPY_AND_ASSIGN(Double);
 };
 
 class Single {
  public:
   static const uint32_t kSignMask = 0x80000000;
   static const uint32_t kExponentMask = 0x7F800000;
   static const uint32_t kSignificandMask = 0x007FFFFF;
   static const uint32_t kHiddenBit = 0x00800000;
@@ -389,14 +389,14 @@ class Single {
   static const int kExponentBias = 0x7F + kPhysicalSignificandSize;
   static const int kDenormalExponent = -kExponentBias + 1;
   static const int kMaxExponent = 0xFF - kExponentBias;
   static const uint32_t kInfinity = 0x7F800000;
   static const uint32_t kNaN = 0x7FC00000;
 
   const uint32_t d32_;
 
-  DISALLOW_COPY_AND_ASSIGN(Single);
+  DC_DISALLOW_COPY_AND_ASSIGN(Single);
 };
 
 }  // namespace double_conversion
 
 #endif  // DOUBLE_CONVERSION_DOUBLE_H_
--- a/mfbt/double-conversion/double-conversion/strtod.cc
+++ b/mfbt/double-conversion/double-conversion/strtod.cc
@@ -200,17 +200,17 @@ static bool DoubleStrtod(Vector<const ch
 #if !defined(DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS)
   // On x86 the floating-point stack can be 64 or 80 bits wide. If it is
   // 80 bits wide (as is the case on Linux) then double-rounding occurs and the
   // result is not accurate.
   // We know that Windows32 uses 64 bits and is therefore accurate.
   // Note that the ARM simulator is compiled for 32bits. It therefore exhibits
   // the same problem.
   return false;
-#endif
+#else
   if (trimmed.length() <= kMaxExactDoubleIntegerDecimalDigits) {
     int read_digits;
     // The trimmed input fits into a double.
     // If the 10^exponent (resp. 10^-exponent) fits into a double too then we
     // can compute the result-double simply by multiplying (resp. dividing) the
     // two numbers.
     // This is possible because IEEE guarantees that floating-point operations
     // return the best possible approximation.
@@ -238,16 +238,17 @@ static bool DoubleStrtod(Vector<const ch
       *result = static_cast<double>(ReadUint64(trimmed, &read_digits));
       ASSERT(read_digits == trimmed.length());
       *result *= exact_powers_of_ten[remaining_digits];
       *result *= exact_powers_of_ten[exponent - remaining_digits];
       return true;
     }
   }
   return false;
+#endif
 }
 
 
 // Returns 10^exponent as an exact DiyFp.
 // The given exponent must be in the range [1; kDecimalExponentDistance[.
 static DiyFp AdjustmentPowerOfTen(int exponent) {
   ASSERT(0 < exponent);
   ASSERT(exponent < PowersOfTenCache::kDecimalExponentDistance);
--- a/mfbt/double-conversion/double-conversion/utils.h
+++ b/mfbt/double-conversion/double-conversion/utils.h
@@ -93,18 +93,34 @@ inline void abort_noreturn() { MOZ_CRASH
 #endif
 
 #if defined(__GNUC__)
 #define DOUBLE_CONVERSION_UNUSED __attribute__((unused))
 #else
 #define DOUBLE_CONVERSION_UNUSED
 #endif
 
+#if defined(_WIN32) && !defined(__MINGW32__)
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;  // NOLINT
+typedef unsigned short uint16_t;  // NOLINT
+typedef int int32_t;
+typedef unsigned int uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+// intptr_t and friends are defined in crtdefs.h through stdio.h.
+
+#else
+
 #include <stdint.h>
 
+#endif
+
 typedef uint16_t uc16;
 
 // The following macro works on both 32 and 64-bit platforms.
 // Usage: instead of writing 0x1234567890123456
 //      write UINT64_2PART_C(0x12345678,90123456);
 #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
 
 
@@ -115,32 +131,32 @@ typedef uint16_t uc16;
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a)                                   \
   ((sizeof(a) / sizeof(*(a))) /                         \
   static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
 #endif
 
 // A macro to disallow the evil copy constructor and operator= functions
 // This should be used in the private: declarations for a class
-#ifndef DISALLOW_COPY_AND_ASSIGN
-#define DISALLOW_COPY_AND_ASSIGN(TypeName)      \
+#ifndef DC_DISALLOW_COPY_AND_ASSIGN
+#define DC_DISALLOW_COPY_AND_ASSIGN(TypeName)      \
   TypeName(const TypeName&);                    \
   void operator=(const TypeName&)
 #endif
 
 // A macro to disallow all the implicit constructors, namely the
 // default constructor, copy constructor and operator= functions.
 //
 // This should be used in the private: declarations for a class
 // that wants to prevent anyone from instantiating it. This is
 // especially useful for classes containing only static methods.
-#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS
-#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
+#ifndef DC_DISALLOW_IMPLICIT_CONSTRUCTORS
+#define DC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
   TypeName();                                    \
-  DISALLOW_COPY_AND_ASSIGN(TypeName)
+  DC_DISALLOW_COPY_AND_ASSIGN(TypeName)
 #endif
 
 namespace double_conversion {
 
 static const int kCharSize = sizeof(char);
 
 // Returns the maximum of the two parameters.
 template <typename T>
@@ -272,17 +288,17 @@ class StringBuilder {
   }
 
  private:
   Vector<char> buffer_;
   int position_;
 
   bool is_finalized() const { return position_ < 0; }
 
-  DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
+  DC_DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder);
 };
 
 // The type-based aliasing rule allows the compiler to assume that pointers of
 // different types (for some definition of different) never alias each other.
 // Thus the following code does not work:
 //
 // float f = foo();
 // int fbits = *(int*)(&f);
--- a/mfbt/double-conversion/update.sh
+++ b/mfbt/double-conversion/update.sh
@@ -6,17 +6,16 @@
 # double-conversion source that we need.  If no revision is specified, the tip
 # revision is used.  See GIT-INFO for the last revision used.
 
 set -e
 
 LOCAL_PATCHES=""
 
 LOCAL_PATCHES="$LOCAL_PATCHES add-mfbt-api-markers.patch"
-LOCAL_PATCHES="$LOCAL_PATCHES use-StandardInteger.patch"
 LOCAL_PATCHES="$LOCAL_PATCHES use-mozilla-assertions.patch"
 LOCAL_PATCHES="$LOCAL_PATCHES ToPrecision-exponential.patch"
 
 TMPDIR=`mktemp --directory`
 LOCAL_CLONE="$TMPDIR/new-double-conversion"
 
 git clone https://github.com/google/double-conversion.git "$LOCAL_CLONE"
 
deleted file mode 100644
--- a/mfbt/double-conversion/use-StandardInteger.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff --git a/mfbt/double-conversion/double-conversion/utils.h b/mfbt/double-conversion/double-conversion/utils.h
---- a/mfbt/double-conversion/double-conversion/utils.h
-+++ b/mfbt/double-conversion/double-conversion/utils.h
-@@ -93,34 +93,18 @@ inline void abort_noreturn() { abort(); 
- #endif
- 
- #if defined(__GNUC__)
- #define DOUBLE_CONVERSION_UNUSED __attribute__((unused))
- #else
- #define DOUBLE_CONVERSION_UNUSED
- #endif
- 
--#if defined(_WIN32) && !defined(__MINGW32__)
--
--typedef signed char int8_t;
--typedef unsigned char uint8_t;
--typedef short int16_t;  // NOLINT
--typedef unsigned short uint16_t;  // NOLINT
--typedef int int32_t;
--typedef unsigned int uint32_t;
--typedef __int64 int64_t;
--typedef unsigned __int64 uint64_t;
--// intptr_t and friends are defined in crtdefs.h through stdio.h.
--
--#else
--
- #include <stdint.h>
- 
--#endif
--
- typedef uint16_t uc16;
- 
- // The following macro works on both 32 and 64-bit platforms.
- // Usage: instead of writing 0x1234567890123456
- //      write UINT64_2PART_C(0x12345678,90123456);
- #define UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
- 
-