Bug 1623957 - Part 13: Replace mozilla::IsSigned with std::is_signed. r=jwalden
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 21 Mar 2020 14:27:11 +0000
changeset 519997 4d6099637f6c1a37482f3453bf7b8959280be648
parent 519996 2b72c54537e7334275160f9fadcd3d6f12011cdb
child 519998 5e7a6d158bc84f9b9094231afa25c58cf901486e
push id37237
push useraiakab@mozilla.com
push dateSat, 21 Mar 2020 21:28:09 +0000
treeherdermozilla-central@a1bea41f99f4 [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 13: Replace mozilla::IsSigned with std::is_signed. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D67661
js/public/Conversions.h
js/src/jsapi-tests/tests.h
--- a/js/public/Conversions.h
+++ b/js/public/Conversions.h
@@ -8,17 +8,16 @@
 
 #ifndef js_Conversions_h
 #define js_Conversions_h
 
 #include "mozilla/Casting.h"
 #include "mozilla/Compiler.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MathAlgorithms.h"
-#include "mozilla/TypeTraits.h"
 #include "mozilla/WrappingOperations.h"
 
 #include <cmath>
 #include <stddef.h>  // size_t
 #include <stdint.h>  // {u,}int{8,16,32,64}_t
 #include <type_traits>
 
 #include "jspubtd.h"
@@ -363,17 +362,17 @@ inline UnsignedInteger ToUnsignedInteger
 
   // Compute the congruent value in the signed range.
   return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1
                                                            : result;
 }
 
 template <typename SignedInteger>
 inline SignedInteger ToSignedInteger(double d) {
-  static_assert(mozilla::IsSigned<SignedInteger>::value,
+  static_assert(std::is_signed_v<SignedInteger>,
                 "SignedInteger must be a signed type");
 
   using UnsignedInteger = std::make_unsigned_t<SignedInteger>;
   UnsignedInteger u = ToUnsignedInteger<UnsignedInteger>(d);
 
   return mozilla::WrapToSigned(u);
 }
 
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -4,17 +4,16 @@
  * 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/. */
 
 #ifndef jsapi_tests_tests_h
 #define jsapi_tests_tests_h
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/TypeTraits.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <type_traits>
 
 #include "gc/GC.h"
@@ -193,17 +192,17 @@ class JSAPITest {
   }
 
   // Note that in some still-supported GCC versions (we think anything before
   // GCC 4.6), this template does not work when the second argument is
   // nullptr. It infers type U = long int. Use CHECK_NULL instead.
   template <typename T, typename U>
   bool checkEqual(const T& actual, const U& expected, const char* actualExpr,
                   const char* expectedExpr, const char* filename, int lineno) {
-    static_assert(mozilla::IsSigned<T>::value == mozilla::IsSigned<U>::value,
+    static_assert(std::is_signed_v<T> == std::is_signed_v<U>,
                   "using CHECK_EQUAL with different-signed inputs triggers "
                   "compiler warnings");
     static_assert(
         std::is_unsigned_v<T> == std::is_unsigned_v<U>,
         "using CHECK_EQUAL with different-signed inputs triggers compiler "
         "warnings");
     return (actual == expected) ||
            fail(JSAPITestString("CHECK_EQUAL failed: expected (") +