From 3584ff9cb2e12429e8fdaef59a6c04205b35e6ab Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 21 Aug 2009 20:27:10 +0000 Subject: [PATCH] iconv: match SUSv3 prototype * libc/include/iconv.h (iconv): Match POSIX prototype. * libc/iconv/lib/iconv.c (iconv): Likewise. --- newlib/ChangeLog | 5 +++++ newlib/libc/iconv/lib/iconv.c | 9 +++++---- newlib/libc/include/iconv.h | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 415be6aa3..9a2647d86 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2009-08-21 Eric Blake + + * libc/include/iconv.h (iconv): Match POSIX prototype. + * libc/iconv/lib/iconv.c (iconv): Likewise. + 2009-08-21 Craig Howland * libm/common/s_remquo.c (remquo): Fix sign of quotient when |x|==|y|. diff --git a/newlib/libc/iconv/lib/iconv.c b/newlib/libc/iconv/lib/iconv.c index ee7124b41..8bbcae192 100644 --- a/newlib/libc/iconv/lib/iconv.c +++ b/newlib/libc/iconv/lib/iconv.c @@ -45,7 +45,7 @@ ANSI_SYNOPSIS #include iconv_t iconv_open (const char *<[to]>, const char *<[from]>); int iconv_close (iconv_t <[cd]>); - size_t iconv (iconv_t <[cd]>, const char **<[inbuf]>, + size_t iconv (iconv_t <[cd]>, char **<[inbuf]>, size_t *<[inbytesleft]>, char **<[outbuf]>, size_t *<[outbytesleft]>), @@ -61,7 +61,7 @@ TRAD_SYNOPSIS #include size_t iconv (<[cd]>, <[in]>, <[inleft]>, <[out]>, <[outleft]>) iconv_t <[cd]>; - const char **<[in]>; + char **<[in]>; size_t *<[inleft]>; char **<[out]>; size_t *<[outleft]>); @@ -168,12 +168,13 @@ _DEFUN(iconv_open, (to, from), size_t _DEFUN(iconv, (cd, inbuf, inbytesleft, outbuf, outbytesleft), iconv_t cd _AND - _CONST char **inbuf _AND + char **inbuf _AND size_t *inbytesleft _AND char **outbuf _AND size_t *outbytesleft) { - return _iconv_r (_REENT, cd, inbuf, inbytesleft, outbuf, outbytesleft); + return _iconv_r (_REENT, cd, (_CONST char **) inbuf, inbytesleft, + outbuf, outbytesleft); } diff --git a/newlib/libc/include/iconv.h b/newlib/libc/include/iconv.h index 5b8fcecff..c4a283afa 100644 --- a/newlib/libc/include/iconv.h +++ b/newlib/libc/include/iconv.h @@ -37,11 +37,11 @@ typedef _iconv_t iconv_t; _BEGIN_STD_C #ifndef _REENT_ONLY -iconv_t +iconv_t _EXFUN(iconv_open, (_CONST char *, _CONST char *)); size_t -_EXFUN(iconv, (iconv_t, _CONST char **, size_t *, char **, size_t *)); +_EXFUN(iconv, (iconv_t, char **, size_t *, char **, size_t *)); int _EXFUN(iconv_close, (iconv_t)); @@ -51,7 +51,7 @@ iconv_t _EXFUN(_iconv_open_r, (struct _reent *, _CONST char *, _CONST char *)); size_t -_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **, +_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **, size_t *, char **, size_t *)); int