Bug 1623957 - Part 12: Replace mozilla::MakeUnsigned with std::make_unsigned. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 21 Mar 2020 14:25:36 +0000
changeset 520013 2b72c54537e7334275160f9fadcd3d6f12011cdb
parent 520012 1079682d79674503220a89867e11308f88f90609
child 520014 4d6099637f6c1a37482f3453bf7b8959280be648
push id110801
push usershindli@mozilla.com
push dateSat, 21 Mar 2020 15:31:45 +0000
treeherderautoland@61a44ad12b15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1623957
milestone76.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 1623957 - Part 12: Replace mozilla::MakeUnsigned with std::make_unsigned. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D67660
js/public/Conversions.h
js/src/wasm/WasmValidate.h
--- a/js/public/Conversions.h
+++ b/js/public/Conversions.h
@@ -366,17 +366,17 @@ inline UnsignedInteger ToUnsignedInteger
                                                            : result;
 }
 
 template <typename SignedInteger>
 inline SignedInteger ToSignedInteger(double d) {
   static_assert(mozilla::IsSigned<SignedInteger>::value,
                 "SignedInteger must be a signed type");
 
-  using UnsignedInteger = typename mozilla::MakeUnsigned<SignedInteger>::Type;
+  using UnsignedInteger = std::make_unsigned_t<SignedInteger>;
   UnsignedInteger u = ToUnsignedInteger<UnsignedInteger>(d);
 
   return mozilla::WrapToSigned(u);
 }
 
 // clang crashes compiling this when targeting arm:
 // https://llvm.org/bugs/show_bug.cgi?id=22974
 #if defined(__arm__) && MOZ_IS_GCC
--- a/js/src/wasm/WasmValidate.h
+++ b/js/src/wasm/WasmValidate.h
@@ -14,17 +14,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #ifndef wasm_validate_h
 #define wasm_validate_h
 
-#include "mozilla/TypeTraits.h"
+#include <type_traits>
 
 #include "ds/Bitmap.h"
 
 #include "wasm/WasmTypes.h"
 
 namespace js {
 namespace wasm {
 
@@ -546,17 +546,17 @@ class Decoder {
     *out = u | (UInt(byte) << numBitsInSevens);
     MOZ_ASSERT_IF(sizeof(UInt) == 4,
                   unsigned(cur_ - before) <= MaxVarU32DecodedBytes);
     return true;
   }
 
   template <typename SInt>
   MOZ_MUST_USE bool readVarS(SInt* out) {
-    using UInt = typename mozilla::MakeUnsigned<SInt>::Type;
+    using UInt = std::make_unsigned_t<SInt>;
     const unsigned numBits = sizeof(SInt) * CHAR_BIT;
     const unsigned remainderBits = numBits % 7;
     const unsigned numBitsInSevens = numBits - remainderBits;
     SInt s = 0;
     uint8_t byte;
     unsigned shift = 0;
     do {
       if (!readFixedU8(&byte)) {