From faf318664d85a4bfcf278a4475904ec850b4efb7 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Sun, 16 Dec 2001 13:58:07 +0000 Subject: 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 --- gcc/f/lex.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'gcc/f/lex.c') diff --git a/gcc/f/lex.c b/gcc/f/lex.c index d0aa829..6169656 100644 --- a/gcc/f/lex.c +++ b/gcc/f/lex.c @@ -396,13 +396,7 @@ ffelex_backslash_ (int c, ffewhereColumnNumber col) case 2: if (ISXDIGIT (c)) { - code *= 16; - if (c >= 'a' && c <= 'f') - code += c - 'a' + 10; - if (c >= 'A' && c <= 'F') - code += c - 'A' + 10; - if (ISDIGIT (c)) - code += c - '0'; + code = (code * 16) + hex_value (c); if (code != 0 || count != 0) { if (count == 0) @@ -603,13 +597,7 @@ ffelex_cfebackslash_ (int *use_d, int *d, FILE *finput) *d = c; break; } - code *= 16; - if (c >= 'a' && c <= 'f') - code += c - 'a' + 10; - if (c >= 'A' && c <= 'F') - code += c - 'A' + 10; - if (ISDIGIT (c)) - code += c - '0'; + code = (code * 16) + hex_value (c); if (code != 0 || count != 0) { if (count == 0) -- cgit v1.1