Commit 4f36463d 4f36463dfe2d17b2932a656fffee9aeb7832abe4 by Sergey Poznyakoff

Variois fixes (mostly to placate gcc)

* examples/base64.c, examples/mta.c,
imap4d/auth_gss.c, imap4d/imap4d.c,
imap4d/preauth.c, libmu_auth/ldap.c,
libmu_auth/virtual.c, libmu_scm/mu_body.c,
libmu_scm/mu_port.c, libproto/mailer/smtp.c,
mailbox/acl.c, mailbox/secret.c, pop3d/pop3d.c,
python/libmu_py/address.c, sql/odbc.c: Fix argument
signedness.

* imap4d/fetch.c, imap4d/store.c (closures):
Change type of `count' to int, to match the
signature of util_msgset.
* include/mailutils/guile.h (mu_scm_message_get): Fix
return type (const is useless here).
* libmu_scm/mu_message.c (mu_scm_message_get): Likewise.
(scm_mu_message_copy): Fix type of the `wr' automatic variable.
* libmu_scm/mu_mime.c (mu_scm_mime_get): Remove const qualifier
from the return type.
* libmu_argp/cmdline.c: Include stdlib.h.
1 parent f0cc7bda
...@@ -94,7 +94,8 @@ main (int argc, char * argv []) ...@@ -94,7 +94,8 @@ main (int argc, char * argv [])
94 MU_ASSERT (mu_stdio_stream_create (&out, stdout, 0)); 94 MU_ASSERT (mu_stdio_stream_create (&out, stdout, 0));
95 MU_ASSERT (mu_stream_open (out)); 95 MU_ASSERT (mu_stream_open (out));
96 96
97 while (mu_stream_read (flt, &buffer, sizeof (buffer), total, &size) == 0 97 while (mu_stream_read (flt, (char*) &buffer,
98 sizeof (buffer), total, &size) == 0
98 && size > 0) 99 && size > 0)
99 { 100 {
100 if (printable && !ISPRINT (buffer)) 101 if (printable && !ISPRINT (buffer))
...@@ -104,7 +105,7 @@ main (int argc, char * argv []) ...@@ -104,7 +105,7 @@ main (int argc, char * argv [])
104 mu_stream_sequential_write (out, outbuf, strlen (outbuf)); 105 mu_stream_sequential_write (out, outbuf, strlen (outbuf));
105 } 106 }
106 else 107 else
107 mu_stream_sequential_write (out, &buffer, size); 108 mu_stream_sequential_write (out, (char*) &buffer, size);
108 total += size; 109 total += size;
109 } 110 }
110 111
......
...@@ -803,7 +803,8 @@ mta_smtp (int argc, char **argv) ...@@ -803,7 +803,8 @@ mta_smtp (int argc, char **argv)
803 { 803 {
804 fd_set rfds; 804 fd_set rfds;
805 struct sockaddr_in his_addr; 805 struct sockaddr_in his_addr;
806 int sfd, len, status; 806 int sfd, status;
807 socklen_t len;
807 808
808 FD_ZERO (&rfds); 809 FD_ZERO (&rfds);
809 FD_SET (fd, &rfds); 810 FD_SET (fd, &rfds);
......
...@@ -114,7 +114,7 @@ auth_gssapi (struct imap4d_command *command, ...@@ -114,7 +114,7 @@ auth_gssapi (struct imap4d_command *command,
114 { 114 {
115 gss_buffer_desc tokbuf, outbuf; 115 gss_buffer_desc tokbuf, outbuf;
116 OM_uint32 maj_stat, min_stat, min_stat2; 116 OM_uint32 maj_stat, min_stat, min_stat2;
117 OM_uint32 cflags; 117 int cflags;
118 OM_uint32 sec_level, mech; 118 OM_uint32 sec_level, mech;
119 gss_ctx_id_t context; 119 gss_ctx_id_t context;
120 gss_cred_id_t cred_handle, server_creds; 120 gss_cred_id_t cred_handle, server_creds;
...@@ -170,8 +170,10 @@ auth_gssapi (struct imap4d_command *command, ...@@ -170,8 +170,10 @@ auth_gssapi (struct imap4d_command *command,
170 170
171 for (;;) 171 for (;;)
172 { 172 {
173 OM_uint32 ret_flags;
174
173 imap4d_getline (&token_str, &token_size, &token_len); 175 imap4d_getline (&token_str, &token_size, &token_len);
174 mu_base64_decode (token_str, token_len, &tmp, &size); 176 mu_base64_decode ((unsigned char*) token_str, token_len, &tmp, &size);
175 tokbuf.value = tmp; 177 tokbuf.value = tmp;
176 tokbuf.length = size; 178 tokbuf.length = size;
177 179
...@@ -183,7 +185,7 @@ auth_gssapi (struct imap4d_command *command, ...@@ -183,7 +185,7 @@ auth_gssapi (struct imap4d_command *command,
183 &client, 185 &client,
184 &mech_type, 186 &mech_type,
185 &outbuf, 187 &outbuf,
186 &cflags, NULL, &cred_handle); 188 &ret_flags, NULL, &cred_handle);
187 free (tmp); 189 free (tmp);
188 if (maj_stat == GSS_S_CONTINUE_NEEDED) 190 if (maj_stat == GSS_S_CONTINUE_NEEDED)
189 { 191 {
...@@ -234,7 +236,7 @@ auth_gssapi (struct imap4d_command *command, ...@@ -234,7 +236,7 @@ auth_gssapi (struct imap4d_command *command,
234 free (tmp); 236 free (tmp);
235 237
236 imap4d_getline (&token_str, &token_size, &token_len); 238 imap4d_getline (&token_str, &token_size, &token_len);
237 mu_base64_decode (token_str, token_len, 239 mu_base64_decode ((unsigned char *) token_str, token_len,
238 (unsigned char **) &tokbuf.value, &tokbuf.length); 240 (unsigned char **) &tokbuf.value, &tokbuf.length);
239 free (token_str); 241 free (token_str);
240 242
......
...@@ -63,7 +63,7 @@ struct fetch_parse_closure ...@@ -63,7 +63,7 @@ struct fetch_parse_closure
63 int isuid; 63 int isuid;
64 mu_list_t fnlist; 64 mu_list_t fnlist;
65 size_t *set; 65 size_t *set;
66 size_t count; 66 int count;
67 }; 67 };
68 68
69 69
......
...@@ -412,7 +412,7 @@ imap4d_session_setup (char *username) ...@@ -412,7 +412,7 @@ imap4d_session_setup (char *username)
412 int 412 int
413 get_client_address (int fd, struct sockaddr_in *pcs) 413 get_client_address (int fd, struct sockaddr_in *pcs)
414 { 414 {
415 int len = sizeof *pcs; 415 socklen_t len = sizeof *pcs;
416 416
417 if (getpeername (fd, (struct sockaddr *) pcs, &len) < 0) 417 if (getpeername (fd, (struct sockaddr *) pcs, &len) < 0)
418 { 418 {
......
...@@ -141,7 +141,7 @@ des_cbc_cksum (gl_des_ctx *ctx, unsigned char *buf, size_t bufsize, ...@@ -141,7 +141,7 @@ des_cbc_cksum (gl_des_ctx *ctx, unsigned char *buf, size_t bufsize,
141 } 141 }
142 bufsize = 0; 142 bufsize = 0;
143 } 143 }
144 gl_des_ecb_crypt (ctx, key, key, 0); 144 gl_des_ecb_crypt (ctx, (char*) key, (char*) key, 0);
145 } 145 }
146 } 146 }
147 147
...@@ -194,8 +194,8 @@ des_string_to_key (char *buf, size_t bufsize, unsigned char key[8]) ...@@ -194,8 +194,8 @@ des_string_to_key (char *buf, size_t bufsize, unsigned char key[8])
194 } 194 }
195 195
196 des_fixup_key_parity (key); 196 des_fixup_key_parity (key);
197 gl_des_setkey (&context, key); 197 gl_des_setkey (&context, (char*) key);
198 des_cbc_cksum (&context, buf, bufsize, key, key); 198 des_cbc_cksum (&context, (unsigned char*) buf, bufsize, key, key);
199 memset (&context, 0, sizeof context); 199 memset (&context, 0, sizeof context);
200 des_fixup_key_parity (key); 200 des_fixup_key_parity (key);
201 } 201 }
...@@ -215,7 +215,7 @@ decode64_buf (const char *name, unsigned char **pbuf, size_t *psize) ...@@ -215,7 +215,7 @@ decode64_buf (const char *name, unsigned char **pbuf, size_t *psize)
215 MU_STREAM_READ | MU_STREAM_NO_CHECK); 215 MU_STREAM_READ | MU_STREAM_NO_CHECK);
216 mu_stream_open (str); 216 mu_stream_open (str);
217 mu_stream_sequential_write (str, name, namelen); 217 mu_stream_sequential_write (str, name, namelen);
218 mu_stream_read (flt, buf, sizeof buf, 0, &size); 218 mu_stream_read (flt, (char*) buf, sizeof buf, 0, &size);
219 mu_stream_destroy (&flt, NULL); 219 mu_stream_destroy (&flt, NULL);
220 mu_stream_destroy (&str, NULL); 220 mu_stream_destroy (&str, NULL);
221 *pbuf = malloc (size); 221 *pbuf = malloc (size);
...@@ -281,7 +281,7 @@ ident_decrypt (const char *file, const char *name) ...@@ -281,7 +281,7 @@ ident_decrypt (const char *file, const char *name)
281 gl_des_ctx ctx; 281 gl_des_ctx ctx;
282 282
283 des_string_to_key (keybuf, sizeof (keybuf), key); 283 des_string_to_key (keybuf, sizeof (keybuf), key);
284 gl_des_setkey (&ctx, key); 284 gl_des_setkey (&ctx, (char*) key);
285 285
286 memcpy (id.chars, buf, size); 286 memcpy (id.chars, buf, size);
287 287
...@@ -469,9 +469,9 @@ int ...@@ -469,9 +469,9 @@ int
469 imap4d_preauth_setup (int fd) 469 imap4d_preauth_setup (int fd)
470 { 470 {
471 struct sockaddr clt_sa, *pclt_sa; 471 struct sockaddr clt_sa, *pclt_sa;
472 int clt_len = sizeof clt_sa; 472 socklen_t clt_len = sizeof clt_sa;
473 struct sockaddr srv_sa, *psrv_sa; 473 struct sockaddr srv_sa, *psrv_sa;
474 int srv_len = sizeof srv_sa; 474 socklen_t srv_len = sizeof srv_sa;
475 char *username = NULL; 475 char *username = NULL;
476 476
477 if (getsockname (fd, &srv_sa, &srv_len) == -1) 477 if (getsockname (fd, &srv_sa, &srv_len) == -1)
......
...@@ -28,7 +28,7 @@ struct store_parse_closure ...@@ -28,7 +28,7 @@ struct store_parse_closure
28 int type; 28 int type;
29 int isuid; 29 int isuid;
30 size_t *set; 30 size_t *set;
31 size_t count; 31 int count;
32 }; 32 };
33 33
34 static int 34 static int
......
...@@ -54,7 +54,7 @@ extern int mu_scm_is_mailbox (SCM scm); ...@@ -54,7 +54,7 @@ extern int mu_scm_is_mailbox (SCM scm);
54 extern void mu_scm_message_init (void); 54 extern void mu_scm_message_init (void);
55 extern SCM mu_scm_message_create (SCM owner, mu_message_t msg); 55 extern SCM mu_scm_message_create (SCM owner, mu_message_t msg);
56 extern int mu_scm_is_message (SCM scm); 56 extern int mu_scm_is_message (SCM scm);
57 extern const mu_message_t mu_scm_message_get (SCM MESG); 57 extern mu_message_t mu_scm_message_get (SCM MESG);
58 58
59 extern int mu_scm_is_body (SCM scm); 59 extern int mu_scm_is_body (SCM scm);
60 extern void mu_scm_body_init (void); 60 extern void mu_scm_body_init (void);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
19 #ifdef HAVE_CONFIG_H 19 #ifdef HAVE_CONFIG_H
20 # include <config.h> 20 # include <config.h>
21 #endif 21 #endif
22 #include <stdlib.h>
22 #include "cmdline.h" 23 #include "cmdline.h"
23 24
24 static struct mu_cmdline_capa *all_cmdline_capa[] = { 25 static struct mu_cmdline_capa *all_cmdline_capa[] = {
......
...@@ -130,7 +130,7 @@ _mu_conn_setup (LDAP **pld) ...@@ -130,7 +130,7 @@ _mu_conn_setup (LDAP **pld)
130 /* if no host but a DN is provided, try DNS SRV to gather the 130 /* if no host but a DN is provided, try DNS SRV to gather the
131 host list */ 131 host list */
132 char *domain = NULL, *hostlist = NULL, **hosts = NULL; 132 char *domain = NULL, *hostlist = NULL, **hosts = NULL;
133 size_t hostcnt; 133 int hostcnt;
134 int i; 134 int i;
135 int len_proto = strlen(lud->lud_scheme); 135 int len_proto = strlen(lud->lud_scheme);
136 136
...@@ -319,8 +319,7 @@ _mu_ldap_bind (LDAP *ld) ...@@ -319,8 +319,7 @@ _mu_ldap_bind (LDAP *ld)
319 || refs) 319 || refs)
320 { 320 {
321 /* FIXME: Use mu_debug_t for that */ 321 /* FIXME: Use mu_debug_t for that */
322 mu_error ("ldap_bind: %s (%d)%s", 322 mu_error ("ldap_bind: %s (%d)%s", ldap_err2string (err), err, msgbuf);
323 ldap_err2string (err), err, msgbuf ? msgbuf : "");
324 323
325 if (matched && *matched) 324 if (matched && *matched)
326 mu_error ("matched DN: %s", matched); 325 mu_error ("matched DN: %s", matched);
...@@ -600,7 +599,7 @@ chk_md5 (const char *db_pass, const char *pass) ...@@ -600,7 +599,7 @@ chk_md5 (const char *db_pass, const char *pass)
600 mu_stream_open (str); 599 mu_stream_open (str);
601 mu_stream_sequential_write (str, db_pass, strlen (db_pass)); 600 mu_stream_sequential_write (str, db_pass, strlen (db_pass));
602 601
603 mu_stream_read (flt, d1, sizeof d1, 0, NULL); 602 mu_stream_read (flt, (char*) d1, sizeof d1, 0, NULL);
604 mu_stream_destroy (&flt, NULL); 603 mu_stream_destroy (&flt, NULL);
605 mu_stream_destroy (&str, NULL); 604 mu_stream_destroy (&str, NULL);
606 605
...@@ -633,7 +632,7 @@ chk_smd5 (const char *db_pass, const char *pass) ...@@ -633,7 +632,7 @@ chk_smd5 (const char *db_pass, const char *pass)
633 return ENOMEM; 632 return ENOMEM;
634 } 633 }
635 634
636 mu_stream_read (flt, d1, size, 0, &size); 635 mu_stream_read (flt, (char*) d1, size, 0, &size);
637 mu_stream_destroy (&flt, NULL); 636 mu_stream_destroy (&flt, NULL);
638 mu_stream_destroy (&str, NULL); 637 mu_stream_destroy (&str, NULL);
639 638
...@@ -672,7 +671,7 @@ chk_sha (const char *db_pass, const char *pass) ...@@ -672,7 +671,7 @@ chk_sha (const char *db_pass, const char *pass)
672 mu_stream_open (str); 671 mu_stream_open (str);
673 mu_stream_sequential_write (str, db_pass, strlen (db_pass)); 672 mu_stream_sequential_write (str, db_pass, strlen (db_pass));
674 673
675 mu_stream_read (flt, d1, sizeof d1, 0, NULL); 674 mu_stream_read (flt, (char*) d1, sizeof d1, 0, NULL);
676 mu_stream_destroy (&flt, NULL); 675 mu_stream_destroy (&flt, NULL);
677 mu_stream_destroy (&str, NULL); 676 mu_stream_destroy (&str, NULL);
678 677
...@@ -705,7 +704,7 @@ chk_ssha (const char *db_pass, const char *pass) ...@@ -705,7 +704,7 @@ chk_ssha (const char *db_pass, const char *pass)
705 return ENOMEM; 704 return ENOMEM;
706 } 705 }
707 706
708 mu_stream_read (flt, d1, size, 0, &size); 707 mu_stream_read (flt, (char*) d1, size, 0, &size);
709 mu_stream_destroy (&flt, NULL); 708 mu_stream_destroy (&flt, NULL);
710 mu_stream_destroy (&str, NULL); 709 mu_stream_destroy (&str, NULL);
711 710
......
...@@ -116,7 +116,7 @@ getpwnam_ip_virtual (const char *u) ...@@ -116,7 +116,7 @@ getpwnam_ip_virtual (const char *u)
116 { 116 {
117 struct sockaddr_in addr; 117 struct sockaddr_in addr;
118 struct passwd *pw = NULL; 118 struct passwd *pw = NULL;
119 int len = sizeof (addr); 119 socklen_t len = sizeof (addr);
120 120
121 if (getsockname (0, (struct sockaddr *)&addr, &len) == 0) 121 if (getsockname (0, (struct sockaddr *)&addr, &len) == 0)
122 { 122 {
......
...@@ -108,7 +108,7 @@ SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0, ...@@ -108,7 +108,7 @@ SCM_DEFINE (scm_mu_body_read_line, "mu-body-read-line", 1, 0, 0,
108 #define FUNC_NAME s_scm_mu_body_read_line 108 #define FUNC_NAME s_scm_mu_body_read_line
109 { 109 {
110 struct mu_body *mbp; 110 struct mu_body *mbp;
111 int n, nread; 111 size_t n, nread;
112 int status; 112 int status;
113 113
114 SCM_ASSERT (mu_scm_is_body (BODY), BODY, SCM_ARG1, FUNC_NAME); 114 SCM_ASSERT (mu_scm_is_body (BODY), BODY, SCM_ARG1, FUNC_NAME);
......
...@@ -168,7 +168,7 @@ mu_scm_message_add_owner (SCM MESG, SCM owner) ...@@ -168,7 +168,7 @@ mu_scm_message_add_owner (SCM MESG, SCM owner)
168 mum->mbox = cell; 168 mum->mbox = cell;
169 } 169 }
170 170
171 const mu_message_t 171 mu_message_t
172 mu_scm_message_get (SCM MESG) 172 mu_scm_message_get (SCM MESG)
173 { 173 {
174 struct mu_message *mum = (struct mu_message *) SCM_CDR (MESG); 174 struct mu_message *mum = (struct mu_message *) SCM_CDR (MESG);
...@@ -234,7 +234,7 @@ SCM_DEFINE (scm_mu_message_copy, "mu-message-copy", 1, 0, 0, ...@@ -234,7 +234,7 @@ SCM_DEFINE (scm_mu_message_copy, "mu-message-copy", 1, 0, 0,
234 == 0 234 == 0
235 && n != 0) 235 && n != 0)
236 { 236 {
237 int wr; 237 size_t wr;
238 int rc; 238 int rc;
239 239
240 rc = mu_stream_write (out, buffer, n, off, &wr); 240 rc = mu_stream_write (out, buffer, n, off, &wr);
......
...@@ -72,7 +72,7 @@ mu_scm_mime_create (SCM owner, mu_mime_t mime) ...@@ -72,7 +72,7 @@ mu_scm_mime_create (SCM owner, mu_mime_t mime)
72 SCM_RETURN_NEWSMOB (mime_tag, mum); 72 SCM_RETURN_NEWSMOB (mime_tag, mum);
73 } 73 }
74 74
75 const mu_mime_t 75 mu_mime_t
76 mu_scm_mime_get (SCM MIME) 76 mu_scm_mime_get (SCM MIME)
77 { 77 {
78 struct mu_mime *mum = (struct mu_mime *) SCM_CDR (MIME); 78 struct mu_mime *mum = (struct mu_mime *) SCM_CDR (MIME);
......
...@@ -121,7 +121,8 @@ mu_port_flush (SCM port) ...@@ -121,7 +121,8 @@ mu_port_flush (SCM port)
121 121
122 if (wrsize) 122 if (wrsize)
123 { 123 {
124 if (mu_stream_write (mp->stream, pt->write_buf, wrsize, mp->offset, &n)) 124 if (mu_stream_write (mp->stream, (char*) pt->write_buf,
125 wrsize, mp->offset, &n))
125 return; 126 return;
126 mp->offset += n; 127 mp->offset += n;
127 } 128 }
...@@ -162,7 +163,7 @@ mu_port_fill_input (SCM port) ...@@ -162,7 +163,7 @@ mu_port_fill_input (SCM port)
162 size_t nread = 0; 163 size_t nread = 0;
163 int status; 164 int status;
164 165
165 status = mu_stream_read (mp->stream, pt->read_buf, pt->read_buf_size, 166 status = mu_stream_read (mp->stream, (char*) pt->read_buf, pt->read_buf_size,
166 mp->offset, &nread); 167 mp->offset, &nread);
167 if (status) 168 if (status)
168 mu_scm_error ("mu_port_fill_input", status, 169 mu_scm_error ("mu_port_fill_input", status,
......
...@@ -632,7 +632,7 @@ smtp_starttls (smtp_t smtp) ...@@ -632,7 +632,7 @@ smtp_starttls (smtp_t smtp)
632 } 632 }
633 633
634 static void 634 static void
635 cram_md5 (char *secret, char *challenge, unsigned char *digest) 635 cram_md5 (char *secret, unsigned char *challenge, unsigned char *digest)
636 { 636 {
637 struct mu_md5_ctx context; 637 struct mu_md5_ctx context;
638 unsigned char ipad[64]; 638 unsigned char ipad[64];
...@@ -645,7 +645,7 @@ cram_md5 (char *secret, char *challenge, unsigned char *digest) ...@@ -645,7 +645,7 @@ cram_md5 (char *secret, char *challenge, unsigned char *digest)
645 return; 645 return;
646 646
647 secret_len = strlen (secret); 647 secret_len = strlen (secret);
648 challenge_len = strlen (challenge); 648 challenge_len = strlen ((char*) challenge);
649 memset (ipad, 0, sizeof (ipad)); 649 memset (ipad, 0, sizeof (ipad));
650 memset (opad, 0, sizeof (opad)); 650 memset (opad, 0, sizeof (opad));
651 651
...@@ -670,7 +670,7 @@ cram_md5 (char *secret, char *challenge, unsigned char *digest) ...@@ -670,7 +670,7 @@ cram_md5 (char *secret, char *challenge, unsigned char *digest)
670 670
671 mu_md5_init_ctx (&context); 671 mu_md5_init_ctx (&context);
672 mu_md5_process_bytes (ipad, sizeof (ipad), &context); 672 mu_md5_process_bytes (ipad, sizeof (ipad), &context);
673 mu_md5_process_bytes ((unsigned char *) challenge, challenge_len, &context); 673 mu_md5_process_bytes (challenge, challenge_len, &context);
674 mu_md5_finish_ctx (&context, digest); 674 mu_md5_finish_ctx (&context, digest);
675 675
676 mu_md5_init_ctx (&context); 676 mu_md5_init_ctx (&context);
...@@ -766,7 +766,7 @@ smtp_auth (smtp_t smtp) ...@@ -766,7 +766,7 @@ smtp_auth (smtp_t smtp)
766 766
767 p = strchr (smtp->buffer, ' ') + 1; 767 p = strchr (smtp->buffer, ' ') + 1;
768 mu_rtrim_cset (p, "\r\n"); 768 mu_rtrim_cset (p, "\r\n");
769 mu_base64_decode (p, strlen (p), &chl, &chlen); 769 mu_base64_decode ((unsigned char*) p, strlen (p), &chl, &chlen);
770 770
771 cram_md5 ((char *) mu_secret_password (secret), chl, digest); 771 cram_md5 ((char *) mu_secret_password (secret), chl, digest);
772 mu_secret_password_unref (secret); 772 mu_secret_password_unref (secret);
...@@ -777,7 +777,7 @@ smtp_auth (smtp_t smtp) ...@@ -777,7 +777,7 @@ smtp_auth (smtp_t smtp)
777 777
778 mu_asnprintf (&buf, &buflen, "%s %s", user, ascii_digest); 778 mu_asnprintf (&buf, &buflen, "%s %s", user, ascii_digest);
779 buflen = strlen (buf); 779 buflen = strlen (buf);
780 mu_base64_encode (buf, buflen, &b64buf, &b64buflen); 780 mu_base64_encode ((unsigned char*) buf, buflen, &b64buf, &b64buflen);
781 b64buf[b64buflen] = '\0'; 781 b64buf[b64buflen] = '\0';
782 free (buf); 782 free (buf);
783 783
...@@ -819,7 +819,7 @@ smtp_auth (smtp_t smtp) ...@@ -819,7 +819,7 @@ smtp_auth (smtp_t smtp)
819 if (buf[c] == '^') 819 if (buf[c] == '^')
820 buf[c] = '\0'; 820 buf[c] = '\0';
821 } 821 }
822 mu_base64_encode (buf, buflen, &b64buf, &b64buflen); 822 mu_base64_encode ((unsigned char*) buf, buflen, &b64buf, &b64buflen);
823 b64buf[b64buflen] = '\0'; 823 b64buf[b64buflen] = '\0';
824 free (buf); 824 free (buf);
825 825
......
...@@ -766,7 +766,7 @@ int ...@@ -766,7 +766,7 @@ int
766 mu_acl_check_fd (mu_acl_t acl, int fd, mu_acl_result_t *pres) 766 mu_acl_check_fd (mu_acl_t acl, int fd, mu_acl_result_t *pres)
767 { 767 {
768 struct sockaddr_in cs; 768 struct sockaddr_in cs;
769 int len = sizeof cs; 769 socklen_t len = sizeof cs;
770 770
771 if (getpeername (fd, (struct sockaddr *) &cs, &len) < 0) 771 if (getpeername (fd, (struct sockaddr *) &cs, &len) < 0)
772 { 772 {
......
...@@ -55,7 +55,7 @@ mu_secret_create (mu_secret_t *psec, const char *value, size_t len) ...@@ -55,7 +55,7 @@ mu_secret_create (mu_secret_t *psec, const char *value, size_t len)
55 return ENOMEM; 55 return ENOMEM;
56 sec->obptr = (unsigned char*)(sec + 1); 56 sec->obptr = (unsigned char*)(sec + 1);
57 sec->clptr = sec->obptr + len + 1; 57 sec->clptr = sec->obptr + len + 1;
58 obfuscate (value, sec->obptr, len); 58 obfuscate ((unsigned char *) value, sec->obptr, len);
59 sec->length = len; 59 sec->length = len;
60 *psec = sec; 60 *psec = sec;
61 mu_secret_ref (sec); 61 mu_secret_ref (sec);
......
...@@ -268,7 +268,7 @@ pop3d_get_client_address (int fd, struct sockaddr_in *pcs) ...@@ -268,7 +268,7 @@ pop3d_get_client_address (int fd, struct sockaddr_in *pcs)
268 } 268 }
269 else 269 else
270 { 270 {
271 int len = sizeof *pcs; 271 socklen_t len = sizeof *pcs;
272 if (getpeername (fd, (struct sockaddr*) pcs, &len) < 0) 272 if (getpeername (fd, (struct sockaddr*) pcs, &len) < 0)
273 { 273 {
274 mu_diag_output (MU_DIAG_ERROR, 274 mu_diag_output (MU_DIAG_ERROR,
......
...@@ -269,7 +269,8 @@ api_address_get_route (PyObject *self, PyObject *args) ...@@ -269,7 +269,8 @@ api_address_get_route (PyObject *self, PyObject *args)
269 static PyObject * 269 static PyObject *
270 api_address_to_string (PyObject *self, PyObject *args) 270 api_address_to_string (PyObject *self, PyObject *args)
271 { 271 {
272 int status, n; 272 int status;
273 size_t n;
273 char buf[256]; 274 char buf[256];
274 PyAddress *py_addr; 275 PyAddress *py_addr;
275 276
......
...@@ -160,7 +160,7 @@ odbc_query (mu_sql_connection_t conn, char *query) ...@@ -160,7 +160,7 @@ odbc_query (mu_sql_connection_t conn, char *query)
160 return MU_ERR_SQL; 160 return MU_ERR_SQL;
161 } 161 }
162 162
163 rc = SQLExecDirect (dp->stmt, query, SQL_NTS); 163 rc = SQLExecDirect (dp->stmt, (SQLCHAR*) query, SQL_NTS);
164 if (rc != SQL_SUCCESS) 164 if (rc != SQL_SUCCESS)
165 { 165 {
166 mu_odbc_diag (dp, SQL_HANDLE_STMT, dp->stmt, "SQLExecDirect"); 166 mu_odbc_diag (dp, SQL_HANDLE_STMT, dp->stmt, "SQLExecDirect");
...@@ -305,7 +305,7 @@ odbc_get_field_number (mu_sql_connection_t conn, const char *fname, ...@@ -305,7 +305,7 @@ odbc_get_field_number (mu_sql_connection_t conn, const char *fname,
305 dp->fnames[i] = name; 305 dp->fnames[i] = name;
306 ret = SQLDescribeCol (dp->stmt, 306 ret = SQLDescribeCol (dp->stmt,
307 i + 1, 307 i + 1,
308 name, 308 (SQLCHAR*) name,
309 namelen + 1, 309 namelen + 1,
310 &namelen, 310 &namelen,
311 NULL, 311 NULL,
...@@ -340,7 +340,7 @@ static const char * ...@@ -340,7 +340,7 @@ static const char *
340 odbc_errstr (mu_sql_connection_t conn) 340 odbc_errstr (mu_sql_connection_t conn)
341 { 341 {
342 struct mu_odbc_data *dp = conn->data; 342 struct mu_odbc_data *dp = conn->data;
343 char state[16]; 343 SQLCHAR state[16];
344 char nbuf[64]; 344 char nbuf[64];
345 SQLINTEGER nerror; 345 SQLINTEGER nerror;
346 SQLSMALLINT msglen; 346 SQLSMALLINT msglen;
...@@ -365,14 +365,14 @@ odbc_errstr (mu_sql_connection_t conn) ...@@ -365,14 +365,14 @@ odbc_errstr (mu_sql_connection_t conn)
365 365
366 snprintf (nbuf, sizeof nbuf, "%d", (int) nerror); 366 snprintf (nbuf, sizeof nbuf, "%d", (int) nerror);
367 length = strlen (dp->err.what) + 1 367 length = strlen (dp->err.what) + 1
368 + strlen (state) + 1 368 + strlen ((char*) state) + 1
369 + strlen (nbuf) + 1 369 + strlen (nbuf) + 1
370 + strlen (dp->err.msg) + 1; 370 + strlen ((char*) dp->err.msg) + 1;
371 if (dp->err.text) 371 if (dp->err.text)
372 free (dp->err.text); 372 free (dp->err.text);
373 dp->err.text = malloc (length); 373 dp->err.text = malloc (length);
374 if (!dp->err.text) 374 if (!dp->err.text)
375 return dp->err.msg; 375 return (char*) dp->err.msg;
376 376
377 snprintf (dp->err.text, length, "%s %s %s %s", dp->err.what, state, nbuf, 377 snprintf (dp->err.text, length, "%s %s %s %s", dp->err.what, state, nbuf,
378 dp->err.msg); 378 dp->err.msg);
......