diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-10-05 16:21:34 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-10-05 16:21:34 +0000 |
commit | 5da1ecf26e0da1c8eb7d6939ce6e1c4bbbeb7f98 (patch) | |
tree | c4e09005c1e1506838b18bc5bde1279009298f56 /gcc/mbchar.c | |
parent | 018fc244dc645ae8ff169d4cfdcf3b8580067410 (diff) | |
download | gcc-5da1ecf26e0da1c8eb7d6939ce6e1c4bbbeb7f98.tar.gz |
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
Diffstat (limited to 'gcc/mbchar.c')
-rw-r--r-- | gcc/mbchar.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/mbchar.c b/gcc/mbchar.c index 0f1794a0344..3978612f342 100644 --- a/gcc/mbchar.c +++ b/gcc/mbchar.c @@ -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 corresponding to the multibyte character at the start of the @@ -94,12 +94,12 @@ char *literal_codeset = NULL; int local_mbtowc (pwc, s, n) wchar_t *pwc; - char *s; + const char *s; size_t n; { static JIS_STATE save_state = ASCII; 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) return -1; @@ -178,8 +178,8 @@ local_mbtowc (pwc, s, n) { JIS_ACTION action; JIS_CHAR_TYPE ch; - unsigned char *ptr; - int i, curr_ch; + const unsigned char *ptr; + size_t i, curr_ch; if (s == NULL) { @@ -260,7 +260,7 @@ local_mbtowc (pwc, s, n) case MAKE_A: case MAKE_J: - ptr = (char *) (t + i + 1); + ptr = (const unsigned char *) (t + i + 1); break; case ERROR: @@ -297,7 +297,7 @@ local_mbtowc (pwc, s, n) int local_mblen (s, n) - char *s; + const char *s; size_t n; { return local_mbtowc (NULL, s, n); |