aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-11-10 04:46:01 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-11-10 04:46:01 +0000
commit9e1ac9154abc68bb0ebaf2b2585b0a204c616240 (patch)
tree1c7f6cbe3e1a0a7f7e51eb6544697b4147b98b27 /gcc/cppexp.c
parent57870f8acd9cb9d86c18104702e6752b9cb08171 (diff)
downloadgcc-9e1ac9154abc68bb0ebaf2b2585b0a204c616240.zip
gcc-9e1ac9154abc68bb0ebaf2b2585b0a204c616240.tar.gz
gcc-9e1ac9154abc68bb0ebaf2b2585b0a204c616240.tar.bz2
cppexp.c (parse_number): Use ISXDIGIT/hex_value.
* cppexp.c (parse_number): Use ISXDIGIT/hex_value. * cpplex.c (hex_digit_value): Use hex_p/hex_value. * cppmain.c (general_init): Call hex_init. From-SVN: r46912
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r--gcc/cppexp.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index ac222ee..f7fe054 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -129,14 +129,9 @@ parse_number (pfile, tok)
{
c = *p;
- if (ISDIGIT (c))
- digit = c - '0';
- /* We believe that in all live character sets, a-f are
- consecutive, and so are A-F. */
- else if (base == 16 && c >= 'a' && c <= 'f')
- digit = c - 'a' + 10;
- else if (base == 16 && c >= 'A' && c <= 'F')
- digit = c - 'A' + 10;
+ if (ISDIGIT (c)
+ || (base == 16 && ISXDIGIT (c)))
+ digit = hex_value (c);
else
break;