projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moody patch fixing compilation warnings
[apps/madmutt.git]
/
charset.c
diff --git
a/charset.c
b/charset.c
index
08c4b0f
..
0652ffc
100644
(file)
--- a/
charset.c
+++ b/
charset.c
@@
-212,9
+212,9
@@
void mutt_set_langinfo_charset (void)
#endif
#endif
-void mutt_canonical_charset (char *dest, size_t dlen, const char *name)
+void mutt_canonical_charset (char *dest, s
s
ize_t dlen, const char *name)
{
{
- size_t i;
+ s
s
ize_t i;
char *p;
char scratch[LONG_STRING];
char *p;
char scratch[LONG_STRING];
@@
-297,19
+297,19
@@
iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
* if you're supplying an outrepl, the target charset should be.
*/
* if you're supplying an outrepl, the target charset should be.
*/
-s
ize_t mutt_iconv (iconv_t cd, const char **inbuf, size_t *
inbytesleft,
- char **outbuf, s
ize_t *
outbytesleft,
+s
size_t mutt_iconv(iconv_t cd, const char **inbuf, ssize_t *
inbytesleft,
+ char **outbuf, s
size_t *
outbytesleft,
const char **inrepls, const char *outrepl)
{
const char **inrepls, const char *outrepl)
{
- size_t ret = 0, ret1;
+ s
s
ize_t ret = 0, ret1;
const char *ib = *inbuf;
const char *ib = *inbuf;
- size_t ibl = *inbytesleft;
+ s
s
ize_t ibl = *inbytesleft;
char *ob = *outbuf;
char *ob = *outbuf;
- size_t obl = *outbytesleft;
+ s
s
ize_t obl = *outbytesleft;
for (;;) {
ret1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
for (;;) {
ret1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
- if (ret1 !=
(size_t) -
1)
+ if (ret1 !=
-
1)
ret += ret1;
if (ibl && obl && errno == EILSEQ) {
if (inrepls) {
ret += ret1;
if (ibl && obl && errno == EILSEQ) {
if (inrepls) {
@@
-318,9
+318,9
@@
size_t mutt_iconv (iconv_t cd, const char **inbuf, size_t * inbytesleft,
for (t = inrepls; *t; t++) {
const char *ib1 = *t;
for (t = inrepls; *t; t++) {
const char *ib1 = *t;
- size_t ibl1 = m_strlen(*t);
+ s
s
ize_t ibl1 = m_strlen(*t);
char *ob1 = ob;
char *ob1 = ob;
- size_t obl1 = obl;
+ s
s
ize_t obl1 = obl;
my_iconv(cd, &ib1, &ibl1, &ob1, &obl1);
if (!ibl1) {
my_iconv(cd, &ib1, &ibl1, &ob1, &obl1);
if (!ibl1) {
@@
-338,7
+338,7
@@
size_t mutt_iconv (iconv_t cd, const char **inbuf, size_t * inbytesleft,
outrepl = "?";
my_iconv(cd, 0, 0, &ob, &obl);
if (obl) {
outrepl = "?";
my_iconv(cd, 0, 0, &ob, &obl);
if (obl) {
- size_t n = m_strlen(outrepl);
+ s
s
ize_t n = m_strlen(outrepl);
if (n > obl) {
outrepl = "?";
if (n > obl) {
outrepl = "?";
@@
-378,7
+378,7
@@
int mutt_convert_string (char **ps, const char *from, const char *to,
int len;
const char *ib;
char *buf, *ob;
int len;
const char *ib;
char *buf, *ob;
- size_t ibl, obl;
+ s
s
ize_t ibl, obl;
const char **inrepls = NULL;
const char *outrepl = NULL;
const char **inrepls = NULL;
const char *outrepl = NULL;
@@
-421,7
+421,7
@@
struct fgetconv_s {
char *p;
char *ob;
char *ib;
char *p;
char *ob;
char *ib;
- size_t ibl;
+ s
s
ize_t ibl;
const char **inrepls;
};
const char **inrepls;
};
@@
-454,10
+454,10
@@
FGETCONV *fgetconv_open (FILE * file, const char *from, const char *to,
return (FGETCONV *) fc;
}
return (FGETCONV *) fc;
}
-char *fgetconvs (char *buf, size_t l, FGETCONV * _fc)
+char *fgetconvs (char *buf, s
s
ize_t l, FGETCONV * _fc)
{
int c;
{
int c;
- size_t r;
+ s
s
ize_t r;
for (r = 0; r + 1 < l;) {
if ((c = fgetconv (_fc)) == EOF)
for (r = 0; r + 1 < l;) {
if ((c = fgetconv (_fc)) == EOF)
@@
-490,7
+490,7
@@
int fgetconv (FGETCONV * _fc)
/* Try to convert some more */
fc->p = fc->ob = fc->bufo;
if (fc->ibl) {
/* Try to convert some more */
fc->p = fc->ob = fc->bufo;
if (fc->ibl) {
- s
ize_t obl = sizeof
(fc->bufo);
+ s
size_t obl = ssizeof
(fc->bufo);
my_iconv(fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob, &obl);
if (fc->p < fc->ob)
my_iconv(fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob, &obl);
if (fc->p < fc->ob)
@@
-514,7
+514,7
@@
int fgetconv (FGETCONV * _fc)
/* Try harder this time to convert some */
if (fc->ibl) {
/* Try harder this time to convert some */
if (fc->ibl) {
- s
ize_t obl = sizeof
(fc->bufo);
+ s
size_t obl = ssizeof
(fc->bufo);
mutt_iconv (fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob,
&obl, fc->inrepls, 0);
mutt_iconv (fc->cd, (const char **) &fc->ib, &fc->ibl, &fc->ob,
&obl, fc->inrepls, 0);
@@
-550,19
+550,19
@@
const char *mutt_get_first_charset (const char *charset)
return fcharset;
}
return fcharset;
}
-static s
ize_t convert_string (const char *f,
size_t flen,
+static s
size_t convert_string (const char *f, s
size_t flen,
const char *from, const char *to,
const char *from, const char *to,
- char **t, size_t * tlen)
+ char **t, s
s
ize_t * tlen)
{
iconv_t cd;
char *buf, *ob;
{
iconv_t cd;
char *buf, *ob;
- size_t obl;
+ s
s
ize_t obl;
ssize_t n;
int e;
cd = mutt_iconv_open (to, from, 0);
if (cd == (iconv_t) (-1))
ssize_t n;
int e;
cd = mutt_iconv_open (to, from, 0);
if (cd == (iconv_t) (-1))
- return
(size_t) (-1)
;
+ return
-1
;
obl = 4 * flen + 1;
ob = buf = xmalloc(obl);
n = my_iconv(cd, &f, &flen, &ob, &obl);
obl = 4 * flen + 1;
ob = buf = xmalloc(obl);
n = my_iconv(cd, &f, &flen, &ob, &obl);
@@
-571,7
+571,7
@@
static size_t convert_string (const char *f, size_t flen,
p_delete(&buf);
iconv_close (cd);
errno = e;
p_delete(&buf);
iconv_close (cd);
errno = e;
- return
(size_t) (-1)
;
+ return
-1
;
}
*ob = '\0';
}
*ob = '\0';
@@
-592,9
+592,9
@@
int mutt_convert_nonmime_string (char **ps)
char *u = *ps;
char *s = NULL;
char *fromcode;
char *u = *ps;
char *s = NULL;
char *fromcode;
- size_t m, n;
- size_t ulen = m_strlen(*ps);
- size_t slen;
+ s
s
ize_t m, n;
+ s
s
ize_t ulen = m_strlen(*ps);
+ s
s
ize_t slen;
if (!u || !*u)
return 0;
if (!u || !*u)
return 0;
@@
-606,7
+606,7
@@
int mutt_convert_nonmime_string (char **ps)
fromcode = p_dupstr(c, n);
m = convert_string (u, ulen, fromcode, Charset, &s, &slen);
p_delete(&fromcode);
fromcode = p_dupstr(c, n);
m = convert_string (u, ulen, fromcode, Charset, &s, &slen);
p_delete(&fromcode);
- if (m !=
(size_t) (-1)
) {
+ if (m !=
-1
) {
p_delete(ps);
*ps = s;
return 0;
p_delete(ps);
*ps = s;
return 0;