summaryrefslogtreecommitdiff
path: root/gcc/java/lex.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-16 13:58:07 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-16 13:58:07 +0000
commit57d46c619353e523fe06cdd22ee3231c57196de3 (patch)
tree98edefa5013064e1fe081d29fa44021bb5888015 /gcc/java/lex.c
parent50460a3733a7a2f66a02eb14cefed62e197804df (diff)
downloadgcc-57d46c619353e523fe06cdd22ee3231c57196de3.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48068 138bc75d-0d04-0410-961f-82ee72b054a4
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 e0595e921a0..36e3827dea8 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 */