yes, compiler warning flags are useful you know ?
also remove the very bad ICONV_CONST idea. if your compiler is stupid
enough not to know about const, then compile with -Dconst and stop the
bullshit.
{N_("Chdir"), OP_CHANGE_DIRECTORY},
{N_("Mask"), OP_ENTER_MASK},
{N_("Help"), OP_HELP},
{N_("Chdir"), OP_CHANGE_DIRECTORY},
{N_("Mask"), OP_ENTER_MASK},
{N_("Help"), OP_HELP},
{N_("Catchup"), OP_CATCHUP},
{N_("Mask"), OP_ENTER_MASK},
{N_("Help"), OP_HELP},
{N_("Catchup"), OP_CATCHUP},
{N_("Mask"), OP_ENTER_MASK},
{N_("Help"), OP_HELP},
const char *elsestring,
unsigned long data, format_flag flags)
{
const char *elsestring,
unsigned long data, format_flag flags)
{
- char fn[SHORT_STRING], tmp[SHORT_STRING], permission[11];
- char date[16], *t_fmt;
+ char fn[SHORT_STRING], tmp[SHORT_STRING], permission[11], date[16];
+ const char *t_fmt;
time_t tnow;
FOLDER *folder = (FOLDER *) data;
struct passwd *pw;
time_t tnow;
FOLDER *folder = (FOLDER *) data;
struct passwd *pw;
#ifdef USE_IMAP
if (folder->ff->imap)
#ifdef USE_IMAP
if (folder->ff->imap)
"latin6", "iso-8859-10"}, /* this is not a bug */
{
"l6", "iso-8859-10"}, {
"latin6", "iso-8859-10"}, /* this is not a bug */
{
"l6", "iso-8859-10"}, {
- "csISOLatin6" "iso-8859-10"}, {
+ "csISOLatin6", "iso-8859-10"}, {
"csKOI8r", "koi8-r"}, {
"MS_Kanji", "Shift_JIS"}, /* Note the underscore! */
{
"csKOI8r", "koi8-r"}, {
"MS_Kanji", "Shift_JIS"}, /* Note the underscore! */
{
-size_t iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t * inbytesleft,
+size_t iconv (iconv_t cd, const char **inbuf, size_t * inbytesleft,
char **outbuf, size_t * outbytesleft)
{
return 0;
char **outbuf, size_t * outbytesleft)
{
return 0;
* if you're supplying an outrepl, the target charset should be.
*/
* if you're supplying an outrepl, the target charset should be.
*/
-size_t mutt_iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t * inbytesleft,
+size_t mutt_iconv (iconv_t cd, const char **inbuf, size_t * inbytesleft,
char **outbuf, size_t * outbytesleft,
char **outbuf, size_t * outbytesleft,
- ICONV_CONST char **inrepls, const char *outrepl)
+ const char **inrepls, const char *outrepl)
- ICONV_CONST char *ib = *inbuf;
+ const char *ib = *inbuf;
size_t ibl = *inbytesleft;
char *ob = *outbuf;
size_t obl = *outbytesleft;
size_t ibl = *inbytesleft;
char *ob = *outbuf;
size_t obl = *outbytesleft;
if (ibl && obl && errno == EILSEQ) {
if (inrepls) {
/* Try replacing the input */
if (ibl && obl && errno == EILSEQ) {
if (inrepls) {
/* Try replacing the input */
for (t = inrepls; *t; t++) {
for (t = inrepls; *t; t++) {
- ICONV_CONST char *ib1 = *t;
size_t ibl1 = str_len (*t);
char *ob1 = ob;
size_t obl1 = obl;
size_t ibl1 = str_len (*t);
char *ob1 = ob;
size_t obl1 = obl;
- ICONV_CONST char *repls[] = { "\357\277\275", "?", 0 };
+ const char *repls[] = { "\357\277\275", "?", 0 };
char *s = *ps;
if (!s || !*s)
char *s = *ps;
if (!s || !*s)
if (to && from && (cd = mutt_iconv_open (to, from, flags)) != (iconv_t) - 1) {
int len;
if (to && from && (cd = mutt_iconv_open (to, from, flags)) != (iconv_t) - 1) {
int len;
char *buf, *ob;
size_t ibl, obl;
char *buf, *ob;
size_t ibl, obl;
- ICONV_CONST char **inrepls = 0;
- char *outrepl = 0;
+ const char **inrepls = NULL;
+ const char *outrepl = NULL;
if (mutt_is_utf8 (to))
outrepl = "\357\277\275";
if (mutt_is_utf8 (to))
outrepl = "\357\277\275";
char *ob;
char *ib;
size_t ibl;
char *ob;
char *ib;
size_t ibl;
- ICONV_CONST char **inrepls;
{
struct fgetconv_s *fc;
iconv_t cd = (iconv_t) - 1;
{
struct fgetconv_s *fc;
iconv_t cd = (iconv_t) - 1;
- static ICONV_CONST char *repls[] = { "\357\277\275", "?", 0 };
+ static const char *repls[] = { "\357\277\275", "?", 0 };
if (from && to)
cd = mutt_iconv_open (to, from, flags);
if (from && to)
cd = mutt_iconv_open (to, from, flags);
if (fc->ibl) {
size_t obl = sizeof (fc->bufo);
if (fc->ibl) {
size_t obl = sizeof (fc->bufo);
- iconv (fc->cd, (ICONV_CONST char **) &fc->ib, &fc->ibl, &fc->ob, &obl);
+ iconv (fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob, &obl);
if (fc->p < fc->ob)
return (unsigned char) *(fc->p)++;
}
if (fc->p < fc->ob)
return (unsigned char) *(fc->p)++;
}
if (fc->ibl) {
size_t obl = sizeof (fc->bufo);
if (fc->ibl) {
size_t obl = sizeof (fc->bufo);
- mutt_iconv (fc->cd, (ICONV_CONST char **) &fc->ib, &fc->ibl, &fc->ob,
+ mutt_iconv (fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob,
&obl, fc->inrepls, 0);
if (fc->p < fc->ob)
return (unsigned char) *(fc->p)++;
&obl, fc->inrepls, 0);
if (fc->p < fc->ob)
return (unsigned char) *(fc->p)++;
-char *mutt_get_first_charset (const char *charset)
+const char *mutt_get_first_charset (const char *charset)
{
static char fcharset[SHORT_STRING];
const char *c, *c1;
{
static char fcharset[SHORT_STRING];
const char *c, *c1;
-static size_t convert_string (ICONV_CONST char *f, size_t flen,
+static size_t convert_string (const char *f, size_t flen,
const char *from, const char *to,
char **t, size_t * tlen)
{
const char *from, const char *to,
char **t, size_t * tlen)
{
#endif
#ifndef HAVE_ICONV
#endif
#ifndef HAVE_ICONV
-#define ICONV_CONST const
iconv_t iconv_open (const char *, const char *);
iconv_t iconv_open (const char *, const char *);
-size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *);
+size_t iconv (iconv_t, const char **, size_t *, char **, size_t *);
int iconv_close (iconv_t);
#endif
int mutt_convert_string (char **, const char *, const char *, int);
int iconv_close (iconv_t);
#endif
int mutt_convert_string (char **, const char *, const char *, int);
-char *mutt_get_first_charset (const char *);
+const char *mutt_get_first_charset (const char *);
int mutt_convert_nonmime_string (char **);
iconv_t mutt_iconv_open (const char *, const char *, int);
int mutt_convert_nonmime_string (char **);
iconv_t mutt_iconv_open (const char *, const char *, int);
-size_t mutt_iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *,
- ICONV_CONST char **, const char *);
+size_t mutt_iconv (iconv_t, const char **, size_t *, char **, size_t *,
+ const char **, const char *);
#ifdef USE_IMAP
/* we can use '/' as a delimiter, imap_complete rewrites it */
if (*s == '=' || *s == '+' || *s == '!') {
#ifdef USE_IMAP
/* we can use '/' as a delimiter, imap_complete rewrites it */
if (*s == '=' || *s == '+' || *s == '!') {
- if (*s == '!')
- p = NONULL (Spoolfile);
- else
- p = NONULL (Maildir);
-
- mutt_concat_path (imap_path, p, s + 1, sizeof (imap_path));
+ const char *q = NONULL(*s == '!' ? Spoolfile : Maildir);
+ mutt_concat_path (imap_path, q, s + 1, sizeof (imap_path));
}
else
strfcpy (imap_path, s, sizeof (imap_path));
}
else
strfcpy (imap_path, s, sizeof (imap_path));
if (_chs && (cd = mutt_iconv_open (_chs, "utf-8", 0)) != (iconv_t) - 1) {
int n = s - uid + 1; /* chars available in original buffer */
char *buf;
if (_chs && (cd = mutt_iconv_open (_chs, "utf-8", 0)) != (iconv_t) - 1) {
int n = s - uid + 1; /* chars available in original buffer */
char *buf;
char *ob;
size_t ibl, obl;
char *ob;
size_t ibl, obl;
outleft = freemem_size - sizeof (size_t);
if (iconv (domain->conv,
outleft = freemem_size - sizeof (size_t);
if (iconv (domain->conv,
- (ICONV_CONST char **) &inptr, &inleft,
+ (const char **) &inptr, &inleft,
&outptr, &outleft)
!= (size_t) (-1))
{
&outptr, &outleft)
!= (size_t) (-1))
{
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
{
char buf[MB_LEN_MAX];
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
{
char buf[MB_LEN_MAX];
char *ob;
size_t ibl, obl, r;
char *ob;
size_t ibl, obl, r;
mbstate_t * ps, iconv_t cd)
{
static mbstate_t mbstate;
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];
char *ob, *t;
size_t ibl, obl, k, r;
char bufi[8], bufo[6];
extern char RFC822Specials[];
extern char RFC822Specials[];
-typedef size_t (*encoder_t) (char *, ICONV_CONST char *, size_t,
+typedef size_t (*encoder_t) (char *, const char *, size_t,
-static size_t convert_string (ICONV_CONST char *f, size_t flen,
+static size_t convert_string (const char *f, size_t flen,
const char *from, const char *to,
char **t, size_t * tlen)
{
const char *from, const char *to,
char **t, size_t * tlen)
{
-static size_t b_encoder (char *s, ICONV_CONST char *d, size_t dlen,
+static size_t b_encoder (char *s, const char *d, size_t dlen,
const char *tocode)
{
char *s0 = s;
const char *tocode)
{
char *s0 = s;
-static size_t q_encoder (char *s, ICONV_CONST char *d, size_t dlen,
+static size_t q_encoder (char *s, const char *d, size_t dlen,
const char *tocode)
{
char hex[] = "0123456789ABCDEF";
const char *tocode)
{
char hex[] = "0123456789ABCDEF";
* tocode, unless fromcode is 0, in which case the data is assumed to
* be already in tocode, which should be 8-bit and stateless.
*/
* tocode, unless fromcode is 0, in which case the data is assumed to
* be already in tocode, which should be 8-bit and stateless.
*/
-static size_t try_block (ICONV_CONST char *d, size_t dlen,
+static size_t try_block (const char *d, size_t dlen,
const char *fromcode, const char *tocode,
encoder_t * encoder, size_t * wlen)
{
char buf1[ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 1];
iconv_t cd;
const char *fromcode, const char *tocode,
encoder_t * encoder, size_t * wlen)
{
char buf1[ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 1];
iconv_t cd;
char *ob, *p;
size_t ibl, obl;
int count, len, len_b, len_q;
char *ob, *p;
size_t ibl, obl;
int count, len, len_b, len_q;
{
char buf1[ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 1];
iconv_t cd;
{
char buf1[ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 1];
iconv_t cd;
char *ob;
size_t ibl, obl, n1, n2;
char *ob;
size_t ibl, obl, n1, n2;
* The input data is assumed to be a single line starting at column col;
* if col is non-zero, the preceding character was a space.
*/
* The input data is assumed to be a single line starting at column col;
* if col is non-zero, the preceding character was a space.
*/
-static int rfc2047_encode (ICONV_CONST char *d, size_t dlen, int col,
+static int rfc2047_encode (const char *d, size_t dlen, int col,
const char *fromcode, const char *charsets,
char **e, size_t * elen, char *specials)
{
const char *fromcode, const char *charsets,
char **e, size_t * elen, char *specials)
{
#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
- ICONV_CONST char *ib, *ub;
char *ob;
size_t ibl, obl, ubl, ubl1, n, ret;
int i;
char *ob;
size_t ibl, obl, ubl, ubl1, n, ret;
int i;
void mutt_convert_to_state (iconv_t cd, char *bufi, size_t * l, STATE * s)
{
char bufo[BUFO_SIZE];
void mutt_convert_to_state (iconv_t cd, char *bufi, size_t * l, STATE * s)
{
char bufo[BUFO_SIZE];
char *ob;
size_t ibl, obl;
char *ob;
size_t ibl, obl;