diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-10 04:46:01 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-11-10 04:46:01 +0000 |
commit | 768169bd1d69862383de4016f7a41719e8be2992 (patch) | |
tree | 1c7f6cbe3e1a0a7f7e51eb6544697b4147b98b27 /gcc/cppexp.c | |
parent | 814c5e8e2bd2e2fbfe7948a10ff5f59c2266af78 (diff) | |
download | gcc-768169bd1d69862383de4016f7a41719e8be2992.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r-- | gcc/cppexp.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c index ac222eebda8..f7fe054b7e0 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; |