From e4e20f43e45bf9e428ebdd81c2ff7b3826cd6c4e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 20 Sep 2011 18:11:52 +0000 Subject: Eliminate sign-comparison warnings in APInt llvm-svn: 140158 --- llvm/lib/Support/APInt.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/APInt.cpp') diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index d7291a1..931c885 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -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'; -- cgit v1.1