Commit 57e9b915 by Kaveh R. Ghazi Committed by Kaveh Ghazi

* tradcif.y (parse_number): Use TOLOWER/ISXDIGIT/hex_value/hex_p.

From-SVN: r46913
parent 9e1ac915
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* 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. * cpplex.c (hex_digit_value): Use hex_p/hex_value.
* cppmain.c (general_init): Call hex_init. * cppmain.c (general_init): Call hex_init.
* tradcif.y (parse_number): Use TOLOWER/ISXDIGIT/hex_value/hex_p.
* config.gcc (i[34567]86-dg-dgux*): Don't set `out_file'. * config.gcc (i[34567]86-dg-dgux*): Don't set `out_file'.
......
...@@ -248,14 +248,11 @@ parse_number (olen) ...@@ -248,14 +248,11 @@ parse_number (olen)
c = *p++; c = *p++;
len--; len--;
if (ISUPPER (c)) if (ISUPPER (c))
c += 'a' - 'A'; c = TOLOWER (c);
if (ISDIGIT (c)) { if (ISDIGIT (c)
n *= base; || (base == 16 && ISXDIGIT (c))) {
n += c - '0'; n = (n * base) + hex_value (c);
} else if (base == 16 && c >= 'a' && c <= 'f') {
n *= base;
n += c - 'a' + 10;
} else { } else {
/* `l' means long, and `u' means unsigned. */ /* `l' means long, and `u' means unsigned. */
while (1) { while (1) {
...@@ -509,12 +506,8 @@ parse_escape (string_ptr) ...@@ -509,12 +506,8 @@ parse_escape (string_ptr)
for (;;) for (;;)
{ {
c = *(*string_ptr)++; c = *(*string_ptr)++;
if (ISDIGIT (c)) if (hex_p (c))
i = (i << 4) + c - '0'; i = (i << 4) + hex_value (c);
else if (c >= 'a' && c <= 'f')
i = (i << 4) + c - 'a' + 10;
else if (c >= 'A' && c <= 'F')
i = (i << 4) + c - 'A' + 10;
else else
{ {
(*string_ptr)--; (*string_ptr)--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment