aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/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/java/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/java/lex.c')
-rw-r--r--gcc/java/lex.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index e0595e9..36e3827 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -567,10 +567,8 @@ java_read_unicode (lex, unicode_escape_p)
{
if ((c = java_read_char (lex)) == UEOF)
return UEOF;
- if (ISDIGIT (c))
- unicode |= (unicode_t)((c-'0') << shift);
- else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
- unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift);
+ if (hex_p (c))
+ unicode |= (unicode_t)(hex_value (c) << shift);
else
java_lex_error ("Non hex digit in Unicode escape sequence", 0);
}
@@ -1064,7 +1062,7 @@ java_lex (java_lval)
{
/* We store in a string (in case it turns out to be a FP) and in
PARTS if we have to process a integer literal. */
- int numeric = (ISDIGIT (c) ? c-'0' : 10 +(c|0x20)-'a');
+ int numeric = hex_value (c);
int count;
/* Remember when we find a valid hexadecimal digit */