Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj
authorJeff Walden <jwalden@mit.edu>
Mon, 23 Jan 2017 15:11:50 -0800
changeset 331732 89b895c219f2b97fc0ded8877b30c337e697bdaa
parent 331731 de8d389998d33716e5c4a5f8a5a161f733373cfe
child 331733 3862719c38c5af9014b317d38aea5ae9981d4634
push id86340
push userjwalden@mit.edu
push dateTue, 31 Jan 2017 00:13:34 +0000
treeherdermozilla-inbound@def2e655ff13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1332797
milestone54.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 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj
.clang-format-ignore
mfbt/STYLE
mfbt/decimal/moz-decimal-utils.h
mfbt/double-conversion/LICENSE
mfbt/double-conversion/README
mfbt/double-conversion/ToPrecision-exponential.patch
mfbt/double-conversion/add-mfbt-api-markers.patch
mfbt/double-conversion/bignum-dtoa.cc
mfbt/double-conversion/bignum-dtoa.h
mfbt/double-conversion/bignum.cc
mfbt/double-conversion/bignum.h
mfbt/double-conversion/cached-powers.cc
mfbt/double-conversion/cached-powers.h
mfbt/double-conversion/diy-fp.cc
mfbt/double-conversion/diy-fp.h
mfbt/double-conversion/double-conversion.cc
mfbt/double-conversion/double-conversion.h
mfbt/double-conversion/fast-dtoa.cc
mfbt/double-conversion/fast-dtoa.h
mfbt/double-conversion/fix-Wshadow-issues.patch
mfbt/double-conversion/fixed-dtoa.cc
mfbt/double-conversion/fixed-dtoa.h
mfbt/double-conversion/ieee.h
mfbt/double-conversion/source/LICENSE
mfbt/double-conversion/source/README
mfbt/double-conversion/source/bignum-dtoa.cc
mfbt/double-conversion/source/bignum-dtoa.h
mfbt/double-conversion/source/bignum.cc
mfbt/double-conversion/source/bignum.h
mfbt/double-conversion/source/cached-powers.cc
mfbt/double-conversion/source/cached-powers.h
mfbt/double-conversion/source/diy-fp.cc
mfbt/double-conversion/source/diy-fp.h
mfbt/double-conversion/source/double-conversion.cc
mfbt/double-conversion/source/double-conversion.h
mfbt/double-conversion/source/fast-dtoa.cc
mfbt/double-conversion/source/fast-dtoa.h
mfbt/double-conversion/source/fixed-dtoa.cc
mfbt/double-conversion/source/fixed-dtoa.h
mfbt/double-conversion/source/ieee.h
mfbt/double-conversion/source/strtod.cc
mfbt/double-conversion/source/strtod.h
mfbt/double-conversion/source/utils.h
mfbt/double-conversion/strtod.cc
mfbt/double-conversion/strtod.h
mfbt/double-conversion/update.sh
mfbt/double-conversion/use-StandardInteger.patch
mfbt/double-conversion/use-mozilla-assertions.patch
mfbt/double-conversion/use-static_assert.patch
mfbt/double-conversion/utils.h
mfbt/moz.build
mfbt/objs.mozbuild
tools/rewriting/ThirdPartyPaths.txt
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -46,17 +46,17 @@
 ^media/libyuv/.*
 ^media/mtransport/.*
 ^media/openmax_dl/.*
 ^media/pocketsphinx/.*
 ^media/sphinxbase/.*
 ^media/webrtc/trunk/.*
 ^memory/jemalloc/src/.*
 ^mfbt/decimal/.*
-^mfbt/double-conversion/.*
+^mfbt/double-conversion/source/.*
 ^mfbt/lz4.*
 ^mobile/android/thirdparty/.*
 ^modules/brotli/.*
 ^modules/freetype2/.*
 ^modules/libbz2/.*
 ^modules/libmar/.*
 ^modules/zlib/.*
 ^netwerk/sctp/src/.*
--- a/mfbt/STYLE
+++ b/mfbt/STYLE
@@ -2,10 +2,10 @@ MFBT uses standard Mozilla style, with t
 
 - Some of the files use a lower-case letter at the start of function names.
   This is because MFBT used to use a different style, and was later converted
   to standard Mozilla style. These functions have not been changed to use an
   upper-case letter because it would cause a lot of churn in other parts of the
   codebase. However, new files should follow standard Mozilla style and use an
   upper-case letter at the start of function names.
 
-- Imported third-party code (such as decimal/*, double-conversion/*, and lz4*)
-  remains in its original style.
+- Imported third-party code (such as decimal/*, double-conversion/source/*, and
+  lz4*) remains in its original style.
--- a/mfbt/decimal/moz-decimal-utils.h
+++ b/mfbt/decimal/moz-decimal-utils.h
@@ -5,17 +5,17 @@
 
 #ifndef MOZ_DECIMAL_UTILS_H
 #define MOZ_DECIMAL_UTILS_H
 
 // This file contains extra includes, defines and typedefs to allow compilation
 // of Decimal.cpp under the Mozilla source without blink core dependencies. Do
 // not include it into any file other than Decimal.cpp.
 
-#include "../double-conversion/double-conversion.h"
+#include "../double-conversion/source/double-conversion.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Casting.h"
 #include "mozilla/FloatingPoint.h"
 
 #include <cmath>
 #include <cstring>
 #include <iomanip>
 #include <limits>
--- a/mfbt/double-conversion/ToPrecision-exponential.patch
+++ b/mfbt/double-conversion/ToPrecision-exponential.patch
@@ -1,13 +1,13 @@
 1e7bf0c636b8cca54dd83456a0f8fa219343e2a1 Bug 608195 - part 2 - extend ToPrecision to tell use whether exponential notation was used
-diff --git a/mfbt/double-conversion/double-conversion.cc b/mfbt/double-conversion/double-conversion.cc
+diff --git a/mfbt/double-conversion/source/double-conversion.cc b/mfbt/double-conversion/source/double-conversion.cc
 index febba6c..394b6a0 100644
---- a/mfbt/double-conversion/double-conversion.cc
-+++ b/mfbt/double-conversion/double-conversion.cc
+--- a/mfbt/double-conversion/source/double-conversion.cc
++++ b/mfbt/double-conversion/source/double-conversion.cc
 @@ -283,7 +283,9 @@ bool DoubleToStringConverter::ToExponential(
  
  bool DoubleToStringConverter::ToPrecision(double value,
                                            int precision,
 +                                          bool* used_exponential_notation,
                                            StringBuilder* result_builder) const {
 +  *used_exponential_notation = false;
    if (Double(value).IsSpecial()) {
@@ -16,20 +16,20 @@ index febba6c..394b6a0 100644
 @@ -325,6 +327,7 @@ bool DoubleToStringConverter::ToPrecision(double value,
        decimal_rep[i] = '0';
      }
  
 +    *used_exponential_notation = true;
      CreateExponentialRepresentation(decimal_rep,
                                      precision,
                                      exponent,
-diff --git a/mfbt/double-conversion/double-conversion.h b/mfbt/double-conversion/double-conversion.h
+diff --git a/mfbt/double-conversion/source/double-conversion.h b/mfbt/double-conversion/source/double-conversion.h
 index 0900ba0..957575c 100644
---- a/mfbt/double-conversion/double-conversion.h
-+++ b/mfbt/double-conversion/double-conversion.h
+--- a/mfbt/double-conversion/source/double-conversion.h
++++ b/mfbt/double-conversion/source/double-conversion.h
 @@ -270,6 +270,7 @@ class DoubleToStringConverter {
    // exponent character, the exponent's sign, and at most 3 exponent digits).
    MFBT_API bool ToPrecision(double value,
                     int precision,
 +                   bool* used_exponential_notation,
                     StringBuilder* result_builder) const;
  
    enum DtoaMode {
--- a/mfbt/double-conversion/add-mfbt-api-markers.patch
+++ b/mfbt/double-conversion/add-mfbt-api-markers.patch
@@ -1,12 +1,12 @@
-diff --git a/mfbt/double-conversion/double-conversion.h b/mfbt/double-conversion/double-conversion.h
+diff --git a/mfbt/double-conversion/source/double-conversion.h b/mfbt/double-conversion/source/double-conversion.h
 index f98edae..c62b16b 100644
---- a/mfbt/double-conversion/double-conversion.h
-+++ b/mfbt/double-conversion/double-conversion.h
+--- a/mfbt/double-conversion/source/double-conversion.h
++++ b/mfbt/double-conversion/source/double-conversion.h
 @@ -28,6 +28,7 @@
  #ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
  #define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
  
 +#include "mozilla/Types.h"
  #include "utils.h"
  
  namespace double_conversion {
--- a/mfbt/double-conversion/fix-Wshadow-issues.patch
+++ b/mfbt/double-conversion/fix-Wshadow-issues.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/double-conversion/strtod.cc b/mfbt/double-conversion/strtod.cc
---- a/mfbt/double-conversion/strtod.cc
-+++ b/mfbt/double-conversion/strtod.cc
+diff --git a/mfbt/double-conversion/source/strtod.cc b/mfbt/double-conversion/source/strtod.cc
+--- a/mfbt/double-conversion/source/strtod.cc
++++ b/mfbt/double-conversion/source/strtod.cc
 @@ -510,16 +510,17 @@ float Strtof(Vector<const char> buffer, 
    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);
@@ -14,19 +14,19 @@ diff --git a/mfbt/double-conversion/strt
    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;
    }
  
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
+diff --git a/mfbt/double-conversion/source/utils.h b/mfbt/double-conversion/source/utils.h
+--- a/mfbt/double-conversion/source/utils.h
++++ b/mfbt/double-conversion/source/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__) || \
rename from mfbt/double-conversion/LICENSE
rename to mfbt/double-conversion/source/LICENSE
rename from mfbt/double-conversion/README
rename to mfbt/double-conversion/source/README
rename from mfbt/double-conversion/bignum-dtoa.cc
rename to mfbt/double-conversion/source/bignum-dtoa.cc
rename from mfbt/double-conversion/bignum-dtoa.h
rename to mfbt/double-conversion/source/bignum-dtoa.h
rename from mfbt/double-conversion/bignum.cc
rename to mfbt/double-conversion/source/bignum.cc
rename from mfbt/double-conversion/bignum.h
rename to mfbt/double-conversion/source/bignum.h
rename from mfbt/double-conversion/cached-powers.cc
rename to mfbt/double-conversion/source/cached-powers.cc
rename from mfbt/double-conversion/cached-powers.h
rename to mfbt/double-conversion/source/cached-powers.h
rename from mfbt/double-conversion/diy-fp.cc
rename to mfbt/double-conversion/source/diy-fp.cc
rename from mfbt/double-conversion/diy-fp.h
rename to mfbt/double-conversion/source/diy-fp.h
rename from mfbt/double-conversion/double-conversion.cc
rename to mfbt/double-conversion/source/double-conversion.cc
rename from mfbt/double-conversion/double-conversion.h
rename to mfbt/double-conversion/source/double-conversion.h
rename from mfbt/double-conversion/fast-dtoa.cc
rename to mfbt/double-conversion/source/fast-dtoa.cc
rename from mfbt/double-conversion/fast-dtoa.h
rename to mfbt/double-conversion/source/fast-dtoa.h
rename from mfbt/double-conversion/fixed-dtoa.cc
rename to mfbt/double-conversion/source/fixed-dtoa.cc
rename from mfbt/double-conversion/fixed-dtoa.h
rename to mfbt/double-conversion/source/fixed-dtoa.h
rename from mfbt/double-conversion/ieee.h
rename to mfbt/double-conversion/source/ieee.h
rename from mfbt/double-conversion/strtod.cc
rename to mfbt/double-conversion/source/strtod.cc
rename from mfbt/double-conversion/strtod.h
rename to mfbt/double-conversion/source/strtod.h
rename from mfbt/double-conversion/utils.h
rename to mfbt/double-conversion/source/utils.h
--- a/mfbt/double-conversion/update.sh
+++ b/mfbt/double-conversion/update.sh
@@ -24,32 +24,33 @@ git clone https://github.com/google/doub
 
 REV=""
 
 if [ "$1" !=  "" ]; then
   git -C "$LOCAL_CLONE" checkout "$1"
 fi
 
 # First clear out everything already present.
-rm -rf ./*
-
-# Restore non-upstream files
-hg revert update.sh
-hg revert $LOCAL_PATCHES
+DEST=./source
+rm -rf "$DEST"
+mkdir "$DEST"
 
 # Copy over critical files.
-cp "$LOCAL_CLONE/LICENSE" ./
-cp "$LOCAL_CLONE/README" ./
+cp "$LOCAL_CLONE/LICENSE" "$DEST/"
+cp "$LOCAL_CLONE/README" "$DEST/"
 
 # Includes
 for header in "$LOCAL_CLONE/src/"*.h; do
-  cp "$header" ./
+  cp "$header" "$DEST/"
 done
 
 # Source
 for ccfile in "$LOCAL_CLONE/src/"*.cc; do
-  cp "$ccfile" ./
+  cp "$ccfile" "$DEST/"
 done
 
 # Now apply our local patches.
 for patch in $LOCAL_PATCHES; do
-  patch -p3 < "$patch"
+  patch --directory "$DEST" --strip 4 < "$patch"
 done
+
+# Update Mercurial file status.
+hg addremove "$DEST"
--- a/mfbt/double-conversion/use-StandardInteger.patch
+++ b/mfbt/double-conversion/use-StandardInteger.patch
@@ -1,12 +1,12 @@
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
+diff --git a/mfbt/double-conversion/source/utils.h b/mfbt/double-conversion/source/utils.h
 index cd3e330..bdc7d4b 100644
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
+--- a/mfbt/double-conversion/source/utils.h
++++ b/mfbt/double-conversion/source/utils.h
 @@ -74,23 +74,7 @@
  #endif
  
  
 -#if defined(_WIN32) && !defined(__MINGW32__)
 -
 -typedef signed char int8_t;
 -typedef unsigned char uint8_t;
--- a/mfbt/double-conversion/use-mozilla-assertions.patch
+++ b/mfbt/double-conversion/use-mozilla-assertions.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
+diff --git a/mfbt/double-conversion/source/utils.h b/mfbt/double-conversion/source/utils.h
+--- a/mfbt/double-conversion/source/utils.h
++++ b/mfbt/double-conversion/source/utils.h
 @@ -31,15 +31,15 @@
  #include <stdlib.h>
  #include <string.h>
  
 -#include <assert.h>
 +#include "mozilla/Assertions.h"
  #ifndef ASSERT
 -#define ASSERT(condition)      (assert(condition))
--- a/mfbt/double-conversion/use-static_assert.patch
+++ b/mfbt/double-conversion/use-static_assert.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
---- a/mfbt/double-conversion/utils.h
-+++ b/mfbt/double-conversion/utils.h
+diff --git a/mfbt/double-conversion/source/utils.h b/mfbt/double-conversion/source/utils.h
+--- a/mfbt/double-conversion/source/utils.h
++++ b/mfbt/double-conversion/source/utils.h
 @@ -275,19 +275,18 @@ class StringBuilder {
  // There is an additional use for BitCast.
  // Recent gccs will warn when they see casts that may result in breakage due to
  // the type-based aliasing rule.  If you have checked that there is no breakage
  // you can use BitCast to cast one pointer type to another.  This confuses gcc
  // enough that it can no longer see that you have cast one pointer type to
  // another thus avoiding the warning.
  template <class Dest, class Source>
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -28,18 +28,18 @@ EXPORTS.mozilla = [
     'Casting.h',
     'ChaosMode.h',
     'Char16.h',
     'CheckedInt.h',
     'Compiler.h',
     'Compression.h',
     'DebugOnly.h',
     'decimal/Decimal.h',
-    'double-conversion/double-conversion.h',
-    'double-conversion/utils.h',
+    'double-conversion/source/double-conversion.h',
+    'double-conversion/source/utils.h',
     'EndianUtils.h',
     'EnumeratedArray.h',
     'EnumeratedRange.h',
     'EnumSet.h',
     'EnumTypeTraits.h',
     'FastBernoulliTrial.h',
     'FloatingPoint.h',
     'GuardObjects.h',
--- a/mfbt/objs.mozbuild
+++ b/mfbt/objs.mozbuild
@@ -2,24 +2,24 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 mfbt_src_lcppsrcs = [
     'Assertions.cpp',
     'ChaosMode.cpp',
-    'double-conversion/bignum-dtoa.cc',
-    'double-conversion/bignum.cc',
-    'double-conversion/cached-powers.cc',
-    'double-conversion/diy-fp.cc',
-    'double-conversion/double-conversion.cc',
-    'double-conversion/fast-dtoa.cc',
-    'double-conversion/fixed-dtoa.cc',
-    'double-conversion/strtod.cc',
+    'double-conversion/source/bignum-dtoa.cc',
+    'double-conversion/source/bignum.cc',
+    'double-conversion/source/cached-powers.cc',
+    'double-conversion/source/diy-fp.cc',
+    'double-conversion/source/double-conversion.cc',
+    'double-conversion/source/fast-dtoa.cc',
+    'double-conversion/source/fixed-dtoa.cc',
+    'double-conversion/source/strtod.cc',
     'FloatingPoint.cpp',
     'HashFunctions.cpp',
     'JSONWriter.cpp',
     'Poison.cpp',
     'SHA1.cpp',
     'TaggedAnonymousMemory.cpp',
     'Unused.cpp',
 ]
--- a/tools/rewriting/ThirdPartyPaths.txt
+++ b/tools/rewriting/ThirdPartyPaths.txt
@@ -39,17 +39,17 @@ media/libvpx/
 media/libyuv/
 media/mtransport/
 media/openmax_dl/
 media/pocketsphinx/
 media/sphinxbase/
 media/webrtc/trunk/
 memory/jemalloc/src/
 mfbt/decimal/
-mfbt/double-conversion/
+mfbt/double-conversion/source/
 mfbt/lz4
 mobile/android/thirdparty/
 modules/brotli/
 modules/freetype2/
 modules/libbz2/
 modules/libmar/
 modules/zlib/
 netwerk/sctp/src/