Eliminate sign-comparison warnings in APInt
authorDouglas Gregor <dgregor@apple.com>
Tue, 20 Sep 2011 18:11:52 +0000 (18:11 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 20 Sep 2011 18:11:52 +0000 (18:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140158 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index d7291a18aa5191b3a792c87856df09473d286f75..931c885b9268f5b65da187775869619d8ed74689 100644 (file)
@@ -54,12 +54,14 @@ inline static unsigned getDigit(char cdigit, uint8_t radix) {
       return r;
 
     r = cdigit - 'A';
-    if (r <= radix - 11U)
+    if (r <= unsigned(radix - 11U))
       return r + 10;
 
     r = cdigit - 'a';
-    if (r <= radix - 11U)
+    if (r <= unsigned(radix - 11U))
       return r + 10;
+    
+    radix = 10;
   }
 
   r = cdigit - '0';