aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/lex.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-10-26 00:01:46 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-10-26 00:01:46 +0000
commit07b5e470a6e5a28f5e887d65c98174318b940812 (patch)
tree76ca02ecce99066ffcf0c9dd82a4c07d5eff2edc /gcc/java/lex.h
parent081b49f1443d4bf4f1ab3718db439719c9f33e8d (diff)
downloadgcc-07b5e470a6e5a28f5e887d65c98174318b940812.zip
gcc-07b5e470a6e5a28f5e887d65c98174318b940812.tar.gz
gcc-07b5e470a6e5a28f5e887d65c98174318b940812.tar.bz2
lex.c (java_new_lexer): Initialize new fields.
* lex.c (java_new_lexer): Initialize new fields. Work around broken iconv() implementations. (java_read_char): Swap bytes if required. Use fallback decoder if required. (byteswap_init, need_byteswap): New globals. (java_destroy_lexer): Only close iconv handle if it is in use. * lex.h (java_lexer): New fields read_anything, byte_swap, use_fallback. Made out_buffer unsigned. From-SVN: r37063
Diffstat (limited to 'gcc/java/lex.h')
-rw-r--r--gcc/java/lex.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/java/lex.h b/gcc/java/lex.h
index 71a030d..ae9eebb 100644
--- a/gcc/java/lex.h
+++ b/gcc/java/lex.h
@@ -115,6 +115,16 @@ typedef struct java_lexer
unicode_t unget_value;
#ifdef HAVE_ICONV
+ /* Nonzero if we've read any bytes. We only recognize the
+ byte-order-marker (BOM) as the first word. */
+ int read_anything : 1;
+
+ /* Nonzero if we have to byte swap. */
+ int byte_swap : 1;
+
+ /* Nonzero if we're using the fallback decoder. */
+ int use_fallback : 1;
+
/* The handle for the iconv converter we're using. */
iconv_t handle;
@@ -132,7 +142,7 @@ typedef struct java_lexer
/* This is a buffer of characters already converted by iconv. We
use `char' here because we're assuming that iconv() converts to
big-endian UCS-2, and then we convert it ourselves. */
- char out_buffer[1024];
+ unsigned char out_buffer[1024];
/* Index of first valid output character. -1 if no valid
characters. */