Commit 07b5e470 by Tom Tromey Committed by Tom Tromey

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
parent 081b49f1
2000-10-24 Tom Tromey <tromey@cygnus.com>
* 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.
2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (register_incomplete_type): Include JDEP_FIELD as a case
......
......@@ -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. */
......
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