Bug 1124029 - Fix unsigned/signed mismatch in MathAlgorithms. r=waldo
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 23 Jan 2015 08:29:36 +1100
changeset 225337 7315bdbef259908fc3464f4916a88ede312ffa98
parent 225336 6785604f4cc8bc7af7543e1aa71589af0e60c3ec
child 225338 1e53e8c79d9f999410fc82ef5ec1488bd225d14a
push id28159
push userryanvm@gmail.com
push dateFri, 23 Jan 2015 17:30:19 +0000
treeherdermozilla-central@a6bbabebed2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs1124029
milestone38.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 1124029 - Fix unsigned/signed mismatch in MathAlgorithms. r=waldo
mfbt/MathAlgorithms.h
--- a/mfbt/MathAlgorithms.h
+++ b/mfbt/MathAlgorithms.h
@@ -377,17 +377,17 @@ public:
 
 template<typename T>
 class CeilingLog2<T, 8>
 {
 public:
   static uint_fast8_t compute(const T aValue)
   {
     // Check for <= 1 to avoid the == 0 undefined case.
-    return aValue <= 1 ? 0 : 64 - CountLeadingZeroes64(aValue - 1);
+    return aValue <= 1 ? 0u : 64u - CountLeadingZeroes64(aValue - 1);
   }
 };
 
 } // namespace detail
 
 /**
  * Compute the log of the least power of 2 greater than or equal to |aValue|.
  *