This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: iconv prototype
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Eric Blake <ebb9 at byu dot net>
- Cc: newlib at sources dot redhat dot com
- Date: Fri, 21 Aug 2009 16:14:47 -0400 (EDT)
- Subject: Re: iconv prototype
Eric,
Ok. It appears to have changed from SUSV2 to SUSV3.
-- Jeff J.
----- Original Message -----
From: "Eric Blake" <ebb9@byu.net>
To: newlib@sources.redhat.com
Sent: Thursday, August 20, 2009 1:04:49 PM GMT -05:00 US/Canada Eastern
Subject: iconv prototype
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Per POSIX, iconv's inbuf argument is non-const (even though an
implementation would be stupid to modify it); this is probably historical
baggage. At any rate, ok to apply this? I intentionally did not modify
_iconv_r, where we can use the const without standards issues.
2009-08-20 Eric Blake <ebb9@byu.net>
* libc/include/iconv.h (iconv): Match POSIX prototype.
* libc/iconv/lib/iconv.c (iconv): Likewise.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkqNgjEACgkQ84KuGfSFAYBfXQCaAlJyFN4kS890pC/SRhGsWFcJ
G3AAnjHfsKIwRK0eLfQwWCevJcgQCbcg
=E3yD
-----END PGP SIGNATURE-----
? libc/autom4te.cache
? libc/libc.info
Index: libc/iconv/lib/iconv.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/iconv/lib/iconv.c,v
retrieving revision 1.4
diff -u -p -r1.4 iconv.c
--- libc/iconv/lib/iconv.c 7 Jul 2004 17:26:38 -0000 1.4
+++ libc/iconv/lib/iconv.c 20 Aug 2009 17:04:04 -0000
@@ -45,7 +45,7 @@ ANSI_SYNOPSIS
#include <iconv.h>
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 <iconv.h>
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);
}
Index: libc/include/iconv.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/iconv.h,v
retrieving revision 1.2
diff -u -p -r1.2 iconv.h
--- libc/include/iconv.h 25 Jun 2004 20:32:44 -0000 1.2
+++ libc/include/iconv.h 20 Aug 2009 17:04:04 -0000
@@ -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