aboutsummaryrefslogtreecommitdiff
path: root/gdb/charset.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-03-23 17:48:09 +0000
committerTom Tromey <tromey@redhat.com>2009-03-23 17:48:09 +0000
commit0dd7fb99eb2e120421bad8daec9c27b9b41869f4 (patch)
treee4a8e95f884b898eb9a5ff6f8beb01b0dfff4996 /gdb/charset.c
parentffcfec52d7a53942def890590b90d070f375a8bd (diff)
downloadgdb-0dd7fb99eb2e120421bad8daec9c27b9b41869f4.zip
gdb-0dd7fb99eb2e120421bad8daec9c27b9b41869f4.tar.gz
gdb-0dd7fb99eb2e120421bad8daec9c27b9b41869f4.tar.bz2
* charset.c (ICONV_CONST) <PHONY_ICONV>: Define.
(iconv): Make 'inbuf' argument const. (convert_between_encodings): Use ICONV_CONST. (wchar_iterate): Likewise.
Diffstat (limited to 'gdb/charset.c')
-rw-r--r--gdb/charset.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/charset.c b/gdb/charset.c
index 5efb849..3c56613 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -86,6 +86,9 @@
#undef iconv
#undef iconv_close
+#undef ICONV_CONST
+#define ICONV_CONST const
+
iconv_t
iconv_open (const char *to, const char *from)
{
@@ -109,7 +112,7 @@ iconv_close (iconv_t arg)
}
size_t
-iconv (iconv_t ucs_flag, char **inbuf, size_t *inbytesleft,
+iconv (iconv_t ucs_flag, const char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
if (ucs_flag)
@@ -440,7 +443,7 @@ convert_between_encodings (const char *from, const char *to,
outp = obstack_base (output) + old_size;
outleft = space_request;
- r = iconv (desc, &inp, &inleft, &outp, &outleft);
+ r = iconv (desc, (ICONV_CONST char **) &inp, &inleft, &outp, &outleft);
/* Now make sure that the object on the obstack only includes
bytes we have converted. */
@@ -580,7 +583,8 @@ wchar_iterate (struct wchar_iterator *iter,
size_t num;
gdb_wchar_t result;
- size_t r = iconv (iter->desc, (char **) &iter->input, &iter->bytes,
+ size_t r = iconv (iter->desc,
+ (ICONV_CONST char **) &iter->input, &iter->bytes,
&outptr, &out_avail);
if (r == (size_t) -1)
{