less warnings
[apps/madmutt.git] / mbyte.c
diff --git a/mbyte.c b/mbyte.c
index 4750581..c9f3540 100644 (file)
--- a/mbyte.c
+++ b/mbyte.c
@@ -1,19 +1,10 @@
 /*
+ * Copyright notice from original mutt:
  * Copyright (C) 2000 Edmund Grimley Evans <edmundo@rano.org>
  *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
  */
 
 /*
@@ -28,6 +19,8 @@
 #include "mbyte.h"
 #include "charset.h"
 
+#include "lib/intl.h"
+
 #include <errno.h>
 
 #include <ctype.h>
@@ -98,7 +91,7 @@ void mutt_set_charset (char *charset)
 static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
 {
   char buf[MB_LEN_MAX];
-  ICONV_CONST char *ib;
+  const char *ib;
   char *ob;
   size_t ibl, obl, r;
 
@@ -109,14 +102,14 @@ static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
     ib = buf;
     ob = s;
     obl = MB_LEN_MAX;
-    r = iconv (cd, &ib, &ibl, &ob, &obl);
+    r = my_iconv(cd, &ib, &ibl, &ob, &obl);
   }
   else {
     ib = "";
     ibl = 1;
     ob = buf;
     obl = sizeof (buf);
-    r = iconv (cd, &ib, &ibl, &ob, &obl);
+    r = my_iconv(cd, &ib, &ibl, &ob, &obl);
   }
   return ob - s;
 }
@@ -145,7 +138,7 @@ size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n,
                       mbstate_t * ps, iconv_t cd)
 {
   static mbstate_t mbstate;
-  ICONV_CONST char *ib, *ibmax;
+  const char *ib, *ibmax;
   char *ob, *t;
   size_t ibl, obl, k, r;
   char bufi[8], bufo[6];
@@ -175,7 +168,7 @@ size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n,
   ibl = 1;
 
   for (;;) {
-    r = iconv (cd, &ib, &ibl, &ob, &obl);
+    r = my_iconv(cd, &ib, &ibl, &ob, &obl);
     if (ob > bufo && (!k || ib > bufi + k)) {
       /* we have a character */
       memset (ps, 0, sizeof (*ps));
@@ -438,7 +431,7 @@ size_t utf8rtowc (wchar_t * pwc, const char *s, size_t n, mbstate_t * _ps)
 
 #endif /* !HAVE_WC_FUNCS */
 
-wchar_t replacement_char ()
+wchar_t replacement_char (void)
 {
   return Charset_is_utf8 ? 0xfffd : '?';
 }