There was some discussion about iconv prototyes here recently, but I kind of
missed it.

Do we always need to live with a warning about a type mismatch, or is the
cast below appropriate?

IOW, do some headers have "const" on them, and others not?

Cheers,
-g

Index: xlate.c
===================================================================
RCS file: /home/cvs/apr/i18n/unix/xlate.c,v
retrieving revision 1.18
diff -u -r1.18 xlate.c
--- xlate.c     2001/01/28 11:33:52     1.18
+++ xlate.c     2001/02/05 05:23:19
@@ -194,7 +194,7 @@
     }
 
     inbytes_left = outbytes_left = sizeof(inbuf);
-    translated = iconv(convset->ich, &inbufptr, 
+    translated = iconv(convset->ich, (const char **)&inbufptr, 
                        &inbytes_left, &outbufptr, &outbytes_left);
     if (translated != (size_t) -1 &&
         inbytes_left == 0 &&
@@ -288,7 +288,7 @@
         char *inbufptr = (char *)inbuf;
         char *outbufptr = outbuf;
         
-        translated = iconv(convset->ich, &inbufptr, 
+        translated = iconv(convset->ich, (const char **)&inbufptr, 
                            inbytes_left, &outbufptr, outbytes_left);
         /* If everything went fine but we ran out of buffer, don't
          * report it as an error.  Caller needs to look at the two

-- 
Greg Stein, http://www.lyra.org/

Reply via email to