diff options
author | tijl <tijl@FreeBSD.org> | 2015-04-15 09:09:20 +0000 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2015-04-15 09:09:20 +0000 |
commit | b0813ee288f64f677a2cebf7815754b027a8215b (patch) | |
tree | 87498bf268bfd011fdf8bf597761671de1049b22 /lib | |
parent | 788163adc0d01b144c16af2c10940df70141614a (diff) | |
download | FreeBSD-src-b0813ee288f64f677a2cebf7815754b027a8215b.zip FreeBSD-src-b0813ee288f64f677a2cebf7815754b027a8215b.tar.gz |
Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html
Adjust all code that calls iconv.
PR: 199099
Exp-run by: antoine
MFC after: 2 weeks
Diffstat (limited to 'lib')
33 files changed, 69 insertions, 72 deletions
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile index 2542a20..9dfad77 100644 --- a/lib/libarchive/Makefile +++ b/lib/libarchive/Makefile @@ -25,7 +25,7 @@ LIBADD+= md .if ${MK_ICONV} != "no" # TODO: This can be changed back to CFLAGS once iconv works correctly # with statically linked binaries. -SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const +SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST= .endif .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ diff --git a/lib/libc/iconv/__iconv.c b/lib/libc/iconv/__iconv.c index c9bee3f..85170b7 100644 --- a/lib/libc/iconv/__iconv.c +++ b/lib/libc/iconv/__iconv.c @@ -31,7 +31,7 @@ #include "iconv-internal.h" size_t -__iconv(iconv_t a, const char **b, size_t *c, char **d, +__iconv(iconv_t a, char **b, size_t *c, char **d, size_t *e, __uint32_t f, size_t *g) { return __bsd___iconv(a, b, c, d, e, f, g); diff --git a/lib/libc/iconv/bsd_iconv.c b/lib/libc/iconv/bsd_iconv.c index f764886..e032a5b 100644 --- a/lib/libc/iconv/bsd_iconv.c +++ b/lib/libc/iconv/bsd_iconv.c @@ -120,7 +120,7 @@ __bsd_iconv_close(iconv_t handle) } size_t -__bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *szout) +__bsd_iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout) { size_t ret; int err; @@ -141,7 +141,7 @@ __bsd_iconv(iconv_t handle, const char **in, size_t *szin, char **out, size_t *s } size_t -__bsd___iconv(iconv_t handle, const char **in, size_t *szin, char **out, +__bsd___iconv(iconv_t handle, char **in, size_t *szin, char **out, size_t *szout, uint32_t flags, size_t *invalids) { size_t ret; diff --git a/lib/libc/iconv/citrus_iconv.h b/lib/libc/iconv/citrus_iconv.h index ac14ac3..99604e9 100644 --- a/lib/libc/iconv/citrus_iconv.h +++ b/lib/libc/iconv/citrus_iconv.h @@ -52,7 +52,7 @@ __END_DECLS */ static __inline int _citrus_iconv_convert(struct _citrus_iconv * __restrict cv, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags, size_t * __restrict nresults) { diff --git a/lib/libc/iconv/citrus_iconv_local.h b/lib/libc/iconv/citrus_iconv_local.h index 12d2fa3..5392da1 100644 --- a/lib/libc/iconv/citrus_iconv_local.h +++ b/lib/libc/iconv/citrus_iconv_local.h @@ -46,7 +46,7 @@ static void _citrus_##_m_##_iconv_uninit_shared \ (struct _citrus_iconv_shared *); \ static int _citrus_##_m_##_iconv_convert \ (struct _citrus_iconv * __restrict, \ - const char * __restrict * __restrict, \ + char * __restrict * __restrict, \ size_t * __restrict, \ char * __restrict * __restrict, \ size_t * __restrict outbytes, \ @@ -75,7 +75,7 @@ typedef void (*_citrus_iconv_uninit_shared_t) (struct _citrus_iconv_shared *); typedef int (*_citrus_iconv_convert_t) (struct _citrus_iconv * __restrict, - const char *__restrict* __restrict, size_t * __restrict, + char *__restrict* __restrict, size_t * __restrict, char * __restrict * __restrict, size_t * __restrict, uint32_t, size_t * __restrict); typedef int (*_citrus_iconv_init_context_t)(struct _citrus_iconv *); diff --git a/lib/libc/iconv/citrus_none.c b/lib/libc/iconv/citrus_none.c index 4f9b254..9ec4bd3 100644 --- a/lib/libc/iconv/citrus_none.c +++ b/lib/libc/iconv/citrus_none.c @@ -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, const char **s, size_t n, + _csid_t *csid, _index_t *idx, 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, const char ** __restrict s, size_t n, + _wc_t * __restrict pwc, char ** __restrict s, size_t n, void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks) { diff --git a/lib/libc/iconv/citrus_stdenc.h b/lib/libc/iconv/citrus_stdenc.h index 28fa29d..50f4dff 100644 --- a/lib/libc/iconv/citrus_stdenc.h +++ b/lib/libc/iconv/citrus_stdenc.h @@ -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, - const char ** __restrict s, size_t n, void * __restrict ps, + char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { diff --git a/lib/libc/iconv/citrus_stdenc_local.h b/lib/libc/iconv/citrus_stdenc_local.h index 7b627a0..141abff 100644 --- a/lib/libc/iconv/citrus_stdenc_local.h +++ b/lib/libc/iconv/citrus_stdenc_local.h @@ -55,7 +55,7 @@ static int _citrus_##_e_##_stdenc_mbtocs \ (struct _citrus_stdenc * __restrict, \ _citrus_csid_t * __restrict, \ _citrus_index_t * __restrict, \ - const char ** __restrict, size_t, \ + 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, \ - const char ** __restrict, size_t, \ + 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, - const char ** __restrict, size_t, + 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, - const char ** __restrict, size_t, + char ** __restrict, size_t, void * __restrict, size_t * __restrict, struct iconv_hooks *); typedef int (*_citrus_stdenc_wctomb_t) diff --git a/lib/libc/iconv/citrus_stdenc_template.h b/lib/libc/iconv/citrus_stdenc_template.h index 21bc5cc..9a05fa7 100644 --- a/lib/libc/iconv/citrus_stdenc_template.h +++ b/lib/libc/iconv/citrus_stdenc_template.h @@ -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, - const char ** __restrict s, size_t n, void * __restrict ps, + 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, const char ** __restrict s, size_t n, + _citrus_wc_t * __restrict wc, char ** __restrict s, size_t n, void * __restrict ps, size_t * __restrict nresult, struct iconv_hooks *hooks) { diff --git a/lib/libc/iconv/iconv-internal.h b/lib/libc/iconv/iconv-internal.h index 9a6b3d9..9937f09 100644 --- a/lib/libc/iconv/iconv-internal.h +++ b/lib/libc/iconv/iconv-internal.h @@ -29,11 +29,11 @@ /* * Interal prototypes for our back-end functions. */ -size_t __bsd___iconv(iconv_t, const char **, size_t *, char **, +size_t __bsd___iconv(iconv_t, char **, size_t *, char **, size_t *, __uint32_t, size_t *); void __bsd___iconv_free_list(char **, size_t); int __bsd___iconv_get_list(char ***, size_t *, __iconv_bool); -size_t __bsd_iconv(iconv_t, const char ** __restrict, +size_t __bsd_iconv(iconv_t, char ** __restrict, size_t * __restrict, char ** __restrict, size_t * __restrict); const char *__bsd_iconv_canonicalize(const char *); diff --git a/lib/libc/iconv/iconv.3 b/lib/libc/iconv/iconv.3 index 81b348b..1a4f8c3 100644 --- a/lib/libc/iconv/iconv.3 +++ b/lib/libc/iconv/iconv.3 @@ -48,7 +48,7 @@ .Ft size_t .Fn iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" .Ft size_t -.Fn __iconv "iconv_t cd" "const char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" +.Fn __iconv "iconv_t cd" "char ** restrict src" "size_t * restrict srcleft" "char ** restrict dst" "size_t * restrict dstleft" "uint32_t flags" "size_t * invalids" .Sh DESCRIPTION The .Fn iconv_open diff --git a/lib/libc/iconv/iconv.c b/lib/libc/iconv/iconv.c index d13c1df..4bd9620 100644 --- a/lib/libc/iconv/iconv.c +++ b/lib/libc/iconv/iconv.c @@ -31,7 +31,7 @@ #include "iconv-internal.h" size_t -iconv(iconv_t a, const char ** __restrict b, +iconv(iconv_t a, char ** __restrict b, size_t * __restrict c, char ** __restrict d, size_t * __restrict e) { diff --git a/lib/libc/iconv/iconv_compat.c b/lib/libc/iconv/iconv_compat.c index dea968f..ded2499 100644 --- a/lib/libc/iconv/iconv_compat.c +++ b/lib/libc/iconv/iconv_compat.c @@ -37,7 +37,7 @@ #include "iconv-internal.h" size_t -__iconv_compat(iconv_t a, const char ** b, size_t * c, char ** d, +__iconv_compat(iconv_t a, char ** b, size_t * c, char ** d, size_t * e, __uint32_t f, size_t *g) { return __bsd___iconv(a, b, c, d, e, f, g); @@ -56,7 +56,7 @@ __iconv_get_list_compat(char ***a, size_t *b, __iconv_bool c) } size_t -iconv_compat(iconv_t a, const char ** __restrict b, +iconv_compat(iconv_t a, char ** __restrict b, size_t * __restrict c, char ** __restrict d, size_t * __restrict e) { diff --git a/lib/libc/locale/cXXrtomb_iconv.h b/lib/libc/locale/cXXrtomb_iconv.h index 0ea553b..d6e7ce0 100644 --- a/lib/libc/locale/cXXrtomb_iconv.h +++ b/lib/libc/locale/cXXrtomb_iconv.h @@ -57,8 +57,7 @@ cXXrtomb_l(char * __restrict s, charXX_t c, mbstate_t * __restrict ps, { _ConversionState *cs; struct _citrus_iconv *handle; - const char *src; - char *dst; + char *src, *dst; size_t srcleft, dstleft, invlen; int err; diff --git a/lib/libc/locale/mbrtocXX_iconv.h b/lib/libc/locale/mbrtocXX_iconv.h index ac85a5a..9eb6f68 100644 --- a/lib/libc/locale/mbrtocXX_iconv.h +++ b/lib/libc/locale/mbrtocXX_iconv.h @@ -99,8 +99,7 @@ mbrtocXX_l(charXX_t * __restrict pc, const char * __restrict s, size_t n, /* Convert as few characters to the dst buffer as possible. */ for (i = 0; ; i++) { - const char *src; - char *dst; + char *src, *dst; size_t srcleft, dstleft, invlen; int err; diff --git a/lib/libiconv_modules/BIG5/citrus_big5.c b/lib/libiconv_modules/BIG5/citrus_big5.c index a8376eb..8dffc65 100644 --- a/lib/libiconv_modules/BIG5/citrus_big5.c +++ b/lib/libiconv_modules/BIG5/citrus_big5.c @@ -269,12 +269,12 @@ static int /*ARGSUSED*/ _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei, wchar_t * __restrict pwc, - const char ** __restrict s, size_t n, + char ** __restrict s, size_t n, _BIG5State * __restrict psenc, size_t * __restrict nresult) { wchar_t wchar; - const char *s0; + char *s0; int c, chlenbak; s0 = *s; diff --git a/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c b/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c index fc32018..ec2c597 100644 --- a/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c +++ b/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c @@ -165,10 +165,10 @@ is_94charset(int c) static int /*ARGSUSED*/ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wc; int ch; diff --git a/lib/libiconv_modules/EUC/citrus_euc.c b/lib/libiconv_modules/EUC/citrus_euc.c index 6483eb5..e0c2d23 100644 --- a/lib/libiconv_modules/EUC/citrus_euc.c +++ b/lib/libiconv_modules/EUC/citrus_euc.c @@ -190,12 +190,12 @@ _citrus_EUC_unpack_state(_EUCEncodingInfo *ei __unused, _EUCState *s, #endif static int -_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, const char **s, +_citrus_EUC_mbrtowc_priv(_EUCEncodingInfo *ei, wchar_t *pwc, char **s, size_t n, _EUCState *psenc, size_t *nresult) { wchar_t wchar; int c, chlenbak, cs, len; - const char *s0, *s1 = NULL; + char *s0, *s1 = NULL; s0 = *s; diff --git a/lib/libiconv_modules/EUCTW/citrus_euctw.c b/lib/libiconv_modules/EUCTW/citrus_euctw.c index c35423e..6c3e9f6 100644 --- a/lib/libiconv_modules/EUCTW/citrus_euctw.c +++ b/lib/libiconv_modules/EUCTW/citrus_euctw.c @@ -176,10 +176,10 @@ _citrus_EUCTW_encoding_module_uninit(_EUCTWEncodingInfo *ei __unused) static int _citrus_EUCTW_mbrtowc_priv(_EUCTWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _EUCTWState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wchar; int c, chlenbak, cs; diff --git a/lib/libiconv_modules/GBK2K/citrus_gbk2k.c b/lib/libiconv_modules/GBK2K/citrus_gbk2k.c index 50ea2da..b64c7e0 100644 --- a/lib/libiconv_modules/GBK2K/citrus_gbk2k.c +++ b/lib/libiconv_modules/GBK2K/citrus_gbk2k.c @@ -149,10 +149,10 @@ _mb_count(wchar_t v) static int _citrus_GBK2K_mbrtowc_priv(_GBK2KEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _GBK2KState * __restrict psenc, size_t * __restrict nresult) { - const char *s0, *s1; + char *s0, *s1; wchar_t wc; int chlenbak, len; diff --git a/lib/libiconv_modules/HZ/citrus_hz.c b/lib/libiconv_modules/HZ/citrus_hz.c index d772b38..13d2f2c 100644 --- a/lib/libiconv_modules/HZ/citrus_hz.c +++ b/lib/libiconv_modules/HZ/citrus_hz.c @@ -175,13 +175,13 @@ _citrus_HZ_unpack_state(_HZEncodingInfo * __restrict ei __unused, static int _citrus_HZ_mbrtowc_priv(_HZEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _HZState * __restrict psenc, size_t * __restrict nresult) { escape_t *candidate, *init; graphic_t *graphic; const range_t *range; - const char *s0; + char *s0; wchar_t wc; int bit, ch, head, len, tail; diff --git a/lib/libiconv_modules/ISO2022/citrus_iso2022.c b/lib/libiconv_modules/ISO2022/citrus_iso2022.c index 3402ba8..f3613d6 100644 --- a/lib/libiconv_modules/ISO2022/citrus_iso2022.c +++ b/lib/libiconv_modules/ISO2022/citrus_iso2022.c @@ -574,7 +574,7 @@ terminate: static wchar_t _ISO2022_sgetwchar(_ISO2022EncodingInfo * __restrict ei __unused, - const char * __restrict string, size_t n, const char ** __restrict result, + char * __restrict string, size_t n, char ** __restrict result, _ISO2022State * __restrict psenc) { const struct seqtable *sp; @@ -842,10 +842,10 @@ asis: static int _citrus_ISO2022_mbrtowc_priv(_ISO2022EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _ISO2022State * __restrict psenc, size_t * __restrict nresult) { - const char *p, *result, *s0; + char *p, *result, *s0; wchar_t wchar; int c, chlenbak; diff --git a/lib/libiconv_modules/JOHAB/citrus_johab.c b/lib/libiconv_modules/JOHAB/citrus_johab.c index a533a85..459f8c9 100644 --- a/lib/libiconv_modules/JOHAB/citrus_johab.c +++ b/lib/libiconv_modules/JOHAB/citrus_johab.c @@ -145,10 +145,10 @@ ishanja(int l, int t) static int /*ARGSUSED*/ _citrus_JOHAB_mbrtowc_priv(_JOHABEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _JOHABState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; int l, t; if (*s == NULL) { diff --git a/lib/libiconv_modules/MSKanji/citrus_mskanji.c b/lib/libiconv_modules/MSKanji/citrus_mskanji.c index 8549699..4330cc8 100644 --- a/lib/libiconv_modules/MSKanji/citrus_mskanji.c +++ b/lib/libiconv_modules/MSKanji/citrus_mskanji.c @@ -153,10 +153,10 @@ _citrus_MSKanji_unpack_state(_MSKanjiEncodingInfo * __restrict ei __unused, static int /*ARGSUSED*/ _citrus_MSKanji_mbrtowc_priv(_MSKanjiEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _MSKanjiState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wchar; int chlenbak, len; diff --git a/lib/libiconv_modules/UES/citrus_ues.c b/lib/libiconv_modules/UES/citrus_ues.c index 45f5416..8516c2a 100644 --- a/lib/libiconv_modules/UES/citrus_ues.c +++ b/lib/libiconv_modules/UES/citrus_ues.c @@ -185,10 +185,10 @@ is_basic(wchar_t wc) static int _citrus_UES_mbrtowc_priv(_UESEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _UESState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; int ch, head, num, tail; wchar_t hi, wc; diff --git a/lib/libiconv_modules/UTF1632/citrus_utf1632.c b/lib/libiconv_modules/UTF1632/citrus_utf1632.c index 4ef4db1..6682ab2 100644 --- a/lib/libiconv_modules/UTF1632/citrus_utf1632.c +++ b/lib/libiconv_modules/UTF1632/citrus_utf1632.c @@ -97,9 +97,9 @@ _citrus_UTF1632_init_state(_UTF1632EncodingInfo *ei __unused, static int _citrus_UTF1632_mbrtowc_priv(_UTF1632EncodingInfo *ei, wchar_t *pwc, - const char **s, size_t n, _UTF1632State *psenc, size_t *nresult) + char **s, size_t n, _UTF1632State *psenc, size_t *nresult) { - const char *s0; + char *s0; size_t result; wchar_t wc = L'\0'; int chlenbak, endian, needlen; diff --git a/lib/libiconv_modules/UTF7/citrus_utf7.c b/lib/libiconv_modules/UTF7/citrus_utf7.c index 53f4f77..ce74cfe 100644 --- a/lib/libiconv_modules/UTF7/citrus_utf7.c +++ b/lib/libiconv_modules/UTF7/citrus_utf7.c @@ -151,11 +151,11 @@ static const char spaces[] = " \t\r\n"; static int _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo * __restrict ei, - uint16_t * __restrict u16, const char ** __restrict s, size_t n, + uint16_t * __restrict u16, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { _UTF7State sv; - const char *s0; + char *s0; int done, i, len; s0 = *s; @@ -244,7 +244,7 @@ ilseq: static int _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { uint32_t u32; diff --git a/lib/libiconv_modules/UTF8/citrus_utf8.c b/lib/libiconv_modules/UTF8/citrus_utf8.c index d7c78d3..1bf433e 100644 --- a/lib/libiconv_modules/UTF8/citrus_utf8.c +++ b/lib/libiconv_modules/UTF8/citrus_utf8.c @@ -177,10 +177,10 @@ _citrus_UTF8_unpack_state(_UTF8EncodingInfo *ei __unused, _UTF8State *s, #endif static int -_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, const char **s, +_citrus_UTF8_mbrtowc_priv(_UTF8EncodingInfo *ei, wchar_t *pwc, char **s, size_t n, _UTF8State *psenc, size_t *nresult) { - const char *s0; + char *s0; wchar_t wchar; int i; uint8_t c; diff --git a/lib/libiconv_modules/VIQR/citrus_viqr.c b/lib/libiconv_modules/VIQR/citrus_viqr.c index dddb0b0..ed91cf6 100644 --- a/lib/libiconv_modules/VIQR/citrus_viqr.c +++ b/lib/libiconv_modules/VIQR/citrus_viqr.c @@ -252,11 +252,11 @@ _citrus_VIQR_unpack_state(_VIQREncodingInfo * __restrict ei __unused, static int _citrus_VIQR_mbrtowc_priv(_VIQREncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, char ** __restrict s, size_t n, _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m, *m0; - const char *s0; + char *s0; wchar_t wc; ssize_t i; int ch, escape; diff --git a/lib/libiconv_modules/ZW/citrus_zw.c b/lib/libiconv_modules/ZW/citrus_zw.c index 097fcfe..1728e3b 100644 --- a/lib/libiconv_modules/ZW/citrus_zw.c +++ b/lib/libiconv_modules/ZW/citrus_zw.c @@ -107,10 +107,10 @@ _citrus_ZW_unpack_state(_ZWEncodingInfo * __restrict ei __unused, static int _citrus_ZW_mbrtowc_priv(_ZWEncodingInfo * __restrict ei, - wchar_t * __restrict pwc, const char **__restrict s, size_t n, + wchar_t * __restrict pwc, char **__restrict s, size_t n, _ZWState * __restrict psenc, size_t * __restrict nresult) { - const char *s0; + char *s0; wchar_t wc; int ch, len; diff --git a/lib/libiconv_modules/iconv_none/citrus_iconv_none.c b/lib/libiconv_modules/iconv_none/citrus_iconv_none.c index 967ee13..9d6cd31 100644 --- a/lib/libiconv_modules/iconv_none/citrus_iconv_none.c +++ b/lib/libiconv_modules/iconv_none/citrus_iconv_none.c @@ -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, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + char * __restrict * __restrict in, size_t * __restrict inbytes, char * __restrict * __restrict out, size_t * __restrict outbytes, uint32_t flags __unused, size_t * __restrict invalids) { diff --git a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c index 7c9b064..fd9a68c 100644 --- a/lib/libiconv_modules/iconv_std/citrus_iconv_std.c +++ b/lib/libiconv_modules/iconv_std/citrus_iconv_std.c @@ -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, const char **s, size_t n, size_t *nresult, + _csid_t *csid, _index_t *idx, 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, - const char * __restrict * __restrict in, size_t * __restrict inbytes, + 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; - const char *tmpin; + char *tmpin; size_t inval, szrin, szrout; int ret, state = 0; diff --git a/lib/libkiconv/xlat16_iconv.c b/lib/libkiconv/xlat16_iconv.c index fee3c77..3efb779 100644 --- a/lib/libkiconv/xlat16_iconv.c +++ b/lib/libkiconv/xlat16_iconv.c @@ -62,7 +62,7 @@ static int chklocale(int, const char *); typedef void *iconv_t; static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); -static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); +static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); #else #include <iconv.h> @@ -71,7 +71,7 @@ static int (*my_iconv_close)(iconv_t); #define my_iconv iconv #define my_iconv_close iconv_close #endif -static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); +static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *); int kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag) @@ -221,8 +221,8 @@ kiconv_xlat16_open(const char *tocode, const char *fromcode, int lcase) src[0] = (u_char)(c >> 8); src[1] = (u_char)c; - ret = my_iconv_char(cd, (const u_char **)&srcp, - &inbytesleft, &dstp, &outbytesleft); + ret = my_iconv_char(cd, &srcp, &inbytesleft, + &dstp, &outbytesleft); if (ret == -1) { table[us] = 0; continue; @@ -338,11 +338,10 @@ my_iconv_init(void) #endif static size_t -my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, +my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf, size_t * olen) { - const u_char *sp; - u_char *dp, ilocal[3], olocal[3]; + u_char *sp, *dp, ilocal[3], olocal[3]; u_char c1, c2; int ret; size_t ir, or; @@ -352,7 +351,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, ir = *ilen; bzero(*obuf, *olen); - ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen); + ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen); c1 = (*obuf)[0]; c2 = (*obuf)[1]; @@ -375,7 +374,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, sp = ilocal; dp = olocal; - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { if (olocal[0] != c1) return (ret); @@ -429,7 +428,7 @@ my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf, sp = ilocal + 1; dp = olocal; - if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) { + if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) { if (olocal[0] == c2) /* * inbuf is a single byte char |