Commit 5da1ecf2 by Kaveh R. Ghazi Committed by Kaveh Ghazi

mbchar.c (literal_codeset, [...]): Constify a char*.

	* mbchar.c (literal_codeset, local_mbtowc, local_mblen): Constify
	a char*.
	(local_mbtowc): Change the type of variable `i' from int to size_t.

	* mbchar.h (ISSJIS1, ISSJIS2): Use parens around && within ||.
	(local_mbtowc, local_mblen, literal_codeset): Constify a char*.

From-SVN: r29827
parent 018fc244
Tue Oct 5 12:16:49 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mbchar.c (literal_codeset, local_mbtowc, local_mblen): Constify
a char*.
(local_mbtowc): Change the type of variable `i' from int to size_t.
* mbchar.h (ISSJIS1, ISSJIS2): Use parens around && within ||.
(local_mbtowc, local_mblen, literal_codeset): Constify a char*.
Tue Oct 5 11:34:52 1999 Michael Meissner <meissner@cygnus.com> Tue Oct 5 11:34:52 1999 Michael Meissner <meissner@cygnus.com>
* ggc-{common,callbacks,none,page,simple}.c (toplevel): Reorder * ggc-{common,callbacks,none,page,simple}.c (toplevel): Reorder
......
...@@ -80,7 +80,7 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = { ...@@ -80,7 +80,7 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = {
}; };
char *literal_codeset = NULL; const char *literal_codeset = NULL;
/* Store into *PWC (if PWC is not null) the wide character /* Store into *PWC (if PWC is not null) the wide character
corresponding to the multibyte character at the start of the corresponding to the multibyte character at the start of the
...@@ -94,12 +94,12 @@ char *literal_codeset = NULL; ...@@ -94,12 +94,12 @@ char *literal_codeset = NULL;
int int
local_mbtowc (pwc, s, n) local_mbtowc (pwc, s, n)
wchar_t *pwc; wchar_t *pwc;
char *s; const char *s;
size_t n; size_t n;
{ {
static JIS_STATE save_state = ASCII; static JIS_STATE save_state = ASCII;
JIS_STATE curr_state = save_state; JIS_STATE curr_state = save_state;
unsigned char *t = (unsigned char *) s; const unsigned char *t = (const unsigned char *) s;
if (s != NULL && n == 0) if (s != NULL && n == 0)
return -1; return -1;
...@@ -178,8 +178,8 @@ local_mbtowc (pwc, s, n) ...@@ -178,8 +178,8 @@ local_mbtowc (pwc, s, n)
{ {
JIS_ACTION action; JIS_ACTION action;
JIS_CHAR_TYPE ch; JIS_CHAR_TYPE ch;
unsigned char *ptr; const unsigned char *ptr;
int i, curr_ch; size_t i, curr_ch;
if (s == NULL) if (s == NULL)
{ {
...@@ -260,7 +260,7 @@ local_mbtowc (pwc, s, n) ...@@ -260,7 +260,7 @@ local_mbtowc (pwc, s, n)
case MAKE_A: case MAKE_A:
case MAKE_J: case MAKE_J:
ptr = (char *) (t + i + 1); ptr = (const unsigned char *) (t + i + 1);
break; break;
case ERROR: case ERROR:
...@@ -297,7 +297,7 @@ local_mbtowc (pwc, s, n) ...@@ -297,7 +297,7 @@ local_mbtowc (pwc, s, n)
int int
local_mblen (s, n) local_mblen (s, n)
char *s; const char *s;
size_t n; size_t n;
{ {
return local_mbtowc (NULL, s, n); return local_mbtowc (NULL, s, n);
......
...@@ -26,16 +26,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,16 +26,16 @@ Boston, MA 02111-1307, USA. */
/* Escape character used for JIS encoding */ /* Escape character used for JIS encoding */
#define JIS_ESC_CHAR 0x1b #define JIS_ESC_CHAR 0x1b
#define ISSJIS1(c) ((c) >= 0x81 && (c) <= 0x9f || (c) >= 0xe0 && (c) <= 0xef) #define ISSJIS1(c) (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0 && (c) <= 0xef))
#define ISSJIS2(c) ((c) >= 0x40 && (c) <= 0x7e || (c) >= 0x80 && (c) <= 0xfc) #define ISSJIS2(c) (((c) >= 0x40 && (c) <= 0x7e) || ((c) >= 0x80 && (c) <= 0xfc))
#define ISEUCJP(c) ((c) >= 0xa1 && (c) <= 0xfe) #define ISEUCJP(c) ((c) >= 0xa1 && (c) <= 0xfe)
#define ISJIS(c) ((c) >= 0x21 && (c) <= 0x7e) #define ISJIS(c) ((c) >= 0x21 && (c) <= 0x7e)
extern int local_mbtowc PROTO ((wchar_t *, char *, size_t)); extern int local_mbtowc PROTO ((wchar_t *, const char *, size_t));
extern int local_mblen PROTO ((char *, size_t)); extern int local_mblen PROTO ((const char *, size_t));
extern int local_mb_cur_max PROTO ((void)); extern int local_mb_cur_max PROTO ((void));
/* The locale being used for multibyte characters in string/char literals. */ /* The locale being used for multibyte characters in string/char literals. */
extern char *literal_codeset; extern const char *literal_codeset;
#endif /* MULTIBYTE_CHARS */ #endif /* MULTIBYTE_CHARS */
#endif #endif
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