[llvm-commits] [llvm] r140158 - /llvm/trunk/lib/Support/APInt.cpp
Douglas Gregor
dgregor at apple.com
Tue Sep 20 11:11:52 PDT 2011
Author: dgregor
Date: Tue Sep 20 13:11:52 2011
New Revision: 140158
URL: http://llvm.org/viewvc/llvm-project?rev=140158&view=rev
Log:
Eliminate sign-comparison warnings in APInt
Modified:
llvm/trunk/lib/Support/APInt.cpp
Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=140158&r1=140157&r2=140158&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Tue Sep 20 13:11:52 2011
@@ -54,12 +54,14 @@
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';
More information about the llvm-commits
mailing list