]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Compiler warning fixes.
authorTimo Sirainen <tss@iki.fi>
Tue, 7 Sep 2010 16:19:40 +0000 (17:19 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 7 Sep 2010 16:19:40 +0000 (17:19 +0100)
src/lib-master/master-auth.c
src/lib-storage/index/index-mail.c
src/lib/fdpass.c
src/login-common/ssl-proxy-openssl.c

index 5090354ed5a432b18219c187cf1c4092f509bd13..ff60ba893c0762ed9ef8c8bf39bfd64291ac8255 100644 (file)
@@ -128,7 +128,7 @@ static void master_auth_connection_input(struct master_auth_connection *conn)
                return;
 
        /* reply is now read */
-       reply = (struct master_auth_reply *)conn->buf;
+       reply = (const void *)conn->buf;
        conn->buf_pos = 0;
 
        if (conn->tag != reply->tag)
index 0caaa4238940a8cb4228038a46e1622bbe4b1b1d..01c39cde2344449cef42cf04d0c41e8bc2f0025a 100644 (file)
@@ -1501,7 +1501,7 @@ void index_mail_set_cache_corrupted(struct mail *mail,
        struct index_mail *imail = (struct index_mail *)mail;
        const char *field_name;
 
-       switch (field) {
+       switch ((int)field) {
        case 0:
                field_name = "fields";
                break;
index d10aa4d3c19cb064a2f12136a8a88219be4e2cb0..c237bb4edb1998e35722b45f962fb64d89d62507 100644 (file)
@@ -107,6 +107,7 @@ ssize_t fd_send(int handle, int send_fd, const void *data, size_t size)
         struct const_iovec iov;
         struct cmsghdr *cmsg;
        char buf[CMSG_SPACE(sizeof(int))];
+       void *cmsg_data;
 
        /* at least one byte is required to be sent with fd passing */
        i_assert(size > 0 && size < INT_MAX);
@@ -129,7 +130,8 @@ ssize_t fd_send(int handle, int send_fd, const void *data, size_t size)
                cmsg->cmsg_level = SOL_SOCKET;
                cmsg->cmsg_type = SCM_RIGHTS;
                cmsg->cmsg_len = CMSG_LEN(sizeof(int));
-               *((int *) CMSG_DATA(cmsg)) = send_fd;
+               cmsg_data = CMSG_DATA(cmsg);
+               *(int *)cmsg_data = send_fd;
 
                /* set the real length we want to use. Do it after all is
                   set just in case CMSG macros required the extra padding
@@ -164,6 +166,7 @@ ssize_t fd_read(int handle, void *data, size_t size, int *fd)
        struct cmsghdr *cmsg;
        ssize_t ret;
        char buf[CMSG_SPACE(sizeof(int))];
+       void *cmsg_data;
 
        i_assert(size > 0 && size < INT_MAX);
 
@@ -193,8 +196,10 @@ ssize_t fd_read(int handle, void *data, size_t size, int *fd)
        cmsg = CMSG_FIRSTHDR(&msg);
        if (!CHECK_MSG(msg) || !CHECK_CMSG(cmsg))
                *fd = -1;
-       else
-               *fd = *((int *) CMSG_DATA(cmsg));
+       else {
+               cmsg_data = CMSG_DATA(cmsg);
+               *fd = *(int *)cmsg_data;
+       }
        return ret;
 }
 
index 45313e9588986b423922654b9e6bde61b45bc1e3..7f71dcc52be937e476faf61458a27414d82bc827 100644 (file)
@@ -706,7 +706,7 @@ const char *ssl_proxy_get_last_error(const struct ssl_proxy *proxy)
 
 const char *ssl_proxy_get_security_string(struct ssl_proxy *proxy)
 {
-       SSL_CIPHER *cipher;
+       const SSL_CIPHER *cipher;
        int bits, alg_bits;
        const char *comp_str;