As a followup to r252547, propate const down the call stack.

This commit is contained in:
Peter Wemm 2013-07-03 18:27:45 +00:00
parent 33e7ec3e83
commit 7900abff04
22 changed files with 47 additions and 47 deletions

View File

@ -83,7 +83,7 @@ _citrus_NONE_stdenc_init_state(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce __unused,
_csid_t *csid, _index_t *idx, char **s, size_t n,
_csid_t *csid, _index_t *idx, const char **s, size_t n,
void *ps __unused, size_t *nresult, struct iconv_hooks *hooks)
{
@ -159,7 +159,7 @@ _citrus_NONE_stdenc_cstomb(struct _citrus_stdenc * __restrict ce __unused,
static int
_citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused,
_wc_t * __restrict pwc, char ** __restrict s, size_t n,
_wc_t * __restrict pwc, const char ** __restrict s, size_t n,
void * __restrict pspriv __unused, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{

View File

@ -69,7 +69,7 @@ _citrus_stdenc_init_state(struct _citrus_stdenc * __restrict ce,
static __inline int
_citrus_stdenc_mbtocs(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
char ** __restrict s, size_t n, void * __restrict ps,
const char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{

View File

@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtocs \
(struct _citrus_stdenc * __restrict, \
_citrus_csid_t * __restrict, \
_citrus_index_t * __restrict, \
char ** __restrict, size_t, \
const char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_cstomb \
@ -66,7 +66,7 @@ static int _citrus_##_e_##_stdenc_cstomb \
static int _citrus_##_e_##_stdenc_mbtowc \
(struct _citrus_stdenc * __restrict, \
_citrus_wc_t * __restrict, \
char ** __restrict, size_t, \
const char ** __restrict, size_t, \
void * __restrict, size_t * __restrict, \
struct iconv_hooks *); \
static int _citrus_##_e_##_stdenc_wctomb \
@ -106,7 +106,7 @@ typedef int (*_citrus_stdenc_init_state_t)
typedef int (*_citrus_stdenc_mbtocs_t)
(struct _citrus_stdenc * __restrict,
_citrus_csid_t * __restrict, _citrus_index_t * __restrict,
char ** __restrict, size_t,
const char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_cstomb_t)
@ -116,7 +116,7 @@ typedef int (*_citrus_stdenc_cstomb_t)
typedef int (*_citrus_stdenc_mbtowc_t)
(struct _citrus_stdenc * __restrict,
_citrus_wc_t * __restrict,
char ** __restrict, size_t,
const char ** __restrict, size_t,
void * __restrict, size_t * __restrict,
struct iconv_hooks *);
typedef int (*_citrus_stdenc_wctomb_t)

View File

@ -112,7 +112,7 @@ _FUNCNAME(stdenc_init_state)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtocs)(struct _citrus_stdenc * __restrict ce,
_citrus_csid_t * __restrict csid, _citrus_index_t * __restrict idx,
char ** __restrict s, size_t n, void * __restrict ps,
const char ** __restrict s, size_t n, void * __restrict ps,
size_t * __restrict nresult, struct iconv_hooks *hooks)
{
wchar_t wc;
@ -151,7 +151,7 @@ _FUNCNAME(stdenc_cstomb)(struct _citrus_stdenc * __restrict ce,
static int
_FUNCNAME(stdenc_mbtowc)(struct _citrus_stdenc * __restrict ce,
_citrus_wc_t * __restrict wc, char ** __restrict s, size_t n,
_citrus_wc_t * __restrict wc, const char ** __restrict s, size_t n,
void * __restrict ps, size_t * __restrict nresult,
struct iconv_hooks *hooks)
{

View File

@ -268,12 +268,12 @@ static int
/*ARGSUSED*/
_citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei,
wchar_t * __restrict pwc,
char ** __restrict s, size_t n,
const char ** __restrict s, size_t n,
_BIG5State * __restrict psenc,
size_t * __restrict nresult)
{
wchar_t wchar;
char *s0;
const char *s0;
int c, chlenbak;
s0 = *s;

View File

@ -163,10 +163,10 @@ is_94charset(int c)
static int
/*ARGSUSED*/
_citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_DECHanyuState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
wchar_t wc;
int ch;

View File

@ -188,12 +188,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInfo *ei __unused, _EUCState *s,
}
static int
_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s,
_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s,
size_t n, _EUCState *psenc, size_t *nresult)
{
wchar_t wchar;
int c, chlenbak, cs, len;
char *s0, *s1 = NULL;
const char *s0, *s1 = NULL;
s0 = *s;

View File

@ -174,10 +174,10 @@ _citrus_EUCTW_encoding_module_uninit(_EUCTWEncodingInfo *ei __unused)
static int
_citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s,
wchar_t * __restrict pwc, const char ** __restrict s,
size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
wchar_t wchar;
int c, chlenbak, cs;

View File

@ -147,10 +147,10 @@ _mb_count(wchar_t v)
static int
_citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_GBK2KState * __restrict psenc, size_t * __restrict nresult)
{
char *s0, *s1;
const char *s0, *s1;
wchar_t wc;
int chlenbak, len;

View File

@ -173,13 +173,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo * __restrict ei __unused,
static int
_citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_HZState * __restrict psenc, size_t * __restrict nresult)
{
escape_t *candidate, *init;
graphic_t *graphic;
const range_t *range;
char *s0;
const char *s0;
wchar_t wc;
int bit, ch, head, len, tail;

View File

@ -572,7 +572,7 @@ terminate:
static wchar_t
_ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused,
char * __restrict string, size_t n, char ** __restrict result,
const char * __restrict string, size_t n, const char ** __restrict result,
_ISO2022State * __restrict psenc)
{
const struct seqtable *sp;
@ -840,10 +840,10 @@ asis:
static int
_citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s,
wchar_t * __restrict pwc, const char ** __restrict s,
size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult)
{
char *p, *result, *s0;
const char *p, *result, *s0;
wchar_t wchar;
int c, chlenbak;

View File

@ -143,10 +143,10 @@ ishanja(int l, int t)
static int
/*ARGSUSED*/
_citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_JOHABState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
int l, t;
if (*s == NULL) {

View File

@ -151,10 +151,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEncodingInfo * __restrict ei __unused,
static int
/*ARGSUSED*/
_citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_MSKanjiState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
wchar_t wchar;
int chlenbak, len;

View File

@ -183,10 +183,10 @@ is_basic(wchar_t wc)
static int
_citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_UESState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
int ch, head, num, tail;
wchar_t hi, wc;

View File

@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632EncodingInfo *ei __unused,
static int
_citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc,
char **s, size_t n, _UTF1632State *psenc, size_t *nresult)
const char **s, size_t n, _UTF1632State *psenc, size_t *nresult)
{
char *s0;
const char *s0;
size_t result;
wchar_t wc = L'\0';
int chlenbak, endian, needlen;

View File

@ -149,11 +149,11 @@ static const char spaces[] = " \t\r\n";
static int
_citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei,
uint16_t * __restrict u16, char ** __restrict s, size_t n,
uint16_t * __restrict u16, const char ** __restrict s, size_t n,
_UTF7State * __restrict psenc, size_t * __restrict nresult)
{
_UTF7State sv;
char *s0;
const char *s0;
int done, i, len;
s0 = *s;
@ -238,10 +238,10 @@ ilseq:
static int
_citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_UTF7State * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
uint32_t u32;
uint16_t hi, lo;
size_t nr, siz;

View File

@ -175,10 +175,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingInfo *ei __unused, _UTF8State *s,
}
static int
_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s,
_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s,
size_t n, _UTF8State *psenc, size_t *nresult)
{
char *s0;
const char *s0;
wchar_t wchar;
int i;
uint8_t c;

View File

@ -250,11 +250,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingInfo * __restrict ei __unused,
static int
_citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char ** __restrict s, size_t n,
wchar_t * __restrict pwc, const char ** __restrict s, size_t n,
_VIQRState * __restrict psenc, size_t * __restrict nresult)
{
mnemonic_t *m, *m0;
char *s0;
const char *s0;
wchar_t wc;
ssize_t i;
int ch, escape;

View File

@ -105,10 +105,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo * __restrict ei __unused,
static int
_citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei,
wchar_t * __restrict pwc, char **__restrict s, size_t n,
wchar_t * __restrict pwc, const char **__restrict s, size_t n,
_ZWState * __restrict psenc, size_t * __restrict nresult)
{
char *s0;
const char *s0;
wchar_t wc;
int ch, len;

View File

@ -97,7 +97,7 @@ _citrus_iconv_none_iconv_uninit_context(struct _citrus_iconv *cv __unused)
static int
/*ARGSUSED*/
_citrus_iconv_none_iconv_convert(struct _citrus_iconv * __restrict ci __unused,
char * __restrict * __restrict in, size_t * __restrict inbytes,
const char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags __unused, size_t * __restrict invalids)
{

View File

@ -104,7 +104,7 @@ init_encoding_state(struct _citrus_iconv_std_encoding *se)
static __inline int
mbtocsx(struct _citrus_iconv_std_encoding *se,
_csid_t *csid, _index_t *idx, char **s, size_t n, size_t *nresult,
_csid_t *csid, _index_t *idx, const char **s, size_t n, size_t *nresult,
struct iconv_hooks *hooks)
{
@ -461,7 +461,7 @@ _citrus_iconv_std_iconv_uninit_context(struct _citrus_iconv *cv)
static int
_citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
char * __restrict * __restrict in, size_t * __restrict inbytes,
const char * __restrict * __restrict in, size_t * __restrict inbytes,
char * __restrict * __restrict out, size_t * __restrict outbytes,
uint32_t flags, size_t * __restrict invalids)
{
@ -469,7 +469,7 @@ _citrus_iconv_std_iconv_convert(struct _citrus_iconv * __restrict cv,
struct _citrus_iconv_std_context *sc = cv->cv_closure;
_csid_t csid;
_index_t idx;
char *tmpin;
const char *tmpin;
size_t inval, szrin, szrout;
int ret, state = 0;

View File

@ -74,7 +74,7 @@ do_conv(FILE *fp, const char *from, const char *to, bool silent,
{
iconv_t cd;
char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out;
char *in;
const char *in;
size_t inbytes, outbytes, ret;
if ((cd = iconv_open(to, from)) == (iconv_t)-1)