Fix ambiguity problem due to builtin log2(double) function
authorChris Lattner <sabre@nondot.org>
Tue, 17 Sep 2002 23:56:50 +0000 (23:56 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Sep 2002 23:56:50 +0000 (23:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3800 91177308-0d34-0410-b5e6-96231b3b80d8

include/Support/MathExtras.h
include/llvm/Support/MathExtras.h

index bd5692b3ddb6fe05dd14f5e9e74ac1147bb5ac0d..d9076580b7e8704c7e087fe877ef63ab1cf9a636 100644 (file)
@@ -19,7 +19,7 @@ inline unsigned log2(uint64_t C) {
 inline bool isPowerOf2(int64_t C, unsigned &getPow) {
   if (C < 0) C = -C;
   if (C > 0 && C == (C & ~(C - 1))) {
-    getPow = log2(C);
+    getPow = log2((uint64_t)C);
     return true;
   }
 
index bd5692b3ddb6fe05dd14f5e9e74ac1147bb5ac0d..d9076580b7e8704c7e087fe877ef63ab1cf9a636 100644 (file)
@@ -19,7 +19,7 @@ inline unsigned log2(uint64_t C) {
 inline bool isPowerOf2(int64_t C, unsigned &getPow) {
   if (C < 0) C = -C;
   if (C > 0 && C == (C & ~(C - 1))) {
-    getPow = log2(C);
+    getPow = log2((uint64_t)C);
     return true;
   }