aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-12-16 13:58:07 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-12-16 13:58:07 +0000
commitfaf318664d85a4bfcf278a4475904ec850b4efb7 (patch)
tree98edefa5013064e1fe081d29fa44021bb5888015 /gcc/c-lex.c
parent15bc166fa03cdd7ab76c21ed2165b1f024042322 (diff)
downloadgcc-faf318664d85a4bfcf278a4475904ec850b4efb7.zip
gcc-faf318664d85a4bfcf278a4475904ec850b4efb7.tar.gz
gcc-faf318664d85a4bfcf278a4475904ec850b4efb7.tar.bz2
c-lex.c (lex_number): Use ISXDIGIT/hex_value.
* c-lex.c (lex_number): Use ISXDIGIT/hex_value. * vax/xm-vms.h (FILE_NAME_NONDIRECTORY): Use ISUPPER/TOLOWER. * fold-const.c (real_hex_to_f): Use hex_value. * real.c (asctoeg): Use hex_value & ISXDIGIT. * toplev.c (toplev_main): Call hex_init. * tradcpp.c (main): Call hex_init. From-SVN: r48068
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index e70be70..7d532b2 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -904,9 +904,10 @@ lex_number (str, len)
/* It is not a decimal point.
It should be a digit (perhaps a hex digit). */
- if (ISDIGIT (c))
+ if (ISDIGIT (c)
+ || (base == 16 && ISXDIGIT (c)))
{
- n = c - '0';
+ n = hex_value (c);
}
else if (base <= 10 && (c == 'e' || c == 'E'))
{
@@ -919,14 +920,6 @@ lex_number (str, len)
floatflag = AFTER_EXPON;
break; /* start of exponent */
}
- else if (base == 16 && c >= 'a' && c <= 'f')
- {
- n = c - 'a' + 10;
- }
- else if (base == 16 && c >= 'A' && c <= 'F')
- {
- n = c - 'A' + 10;
- }
else
{
p--;