dovecot-2.0: Compiler warning fixes.

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 7 19:29:44 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/d72b4a74a992
changeset: 12083:d72b4a74a992
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 07 17:19:40 2010 +0100
description:
Compiler warning fixes.

diffstat:

 src/lib-master/master-auth.c         |   2 +-
 src/lib-storage/index/index-mail.c   |   2 +-
 src/lib/fdpass.c                     |  11 ++++++++---
 src/login-common/ssl-proxy-openssl.c |   2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)

diffs (78 lines):

diff -r c7e1c71c5ec5 -r d72b4a74a992 src/lib-master/master-auth.c
--- a/src/lib-master/master-auth.c	Tue Sep 07 16:32:17 2010 +0100
+++ b/src/lib-master/master-auth.c	Tue Sep 07 17:19:40 2010 +0100
@@ -128,7 +128,7 @@
 		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)
diff -r c7e1c71c5ec5 -r d72b4a74a992 src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c	Tue Sep 07 16:32:17 2010 +0100
+++ b/src/lib-storage/index/index-mail.c	Tue Sep 07 17:19:40 2010 +0100
@@ -1501,7 +1501,7 @@
 	struct index_mail *imail = (struct index_mail *)mail;
 	const char *field_name;
 
-	switch (field) {
+	switch ((int)field) {
 	case 0:
 		field_name = "fields";
 		break;
diff -r c7e1c71c5ec5 -r d72b4a74a992 src/lib/fdpass.c
--- a/src/lib/fdpass.c	Tue Sep 07 16:32:17 2010 +0100
+++ b/src/lib/fdpass.c	Tue Sep 07 17:19:40 2010 +0100
@@ -107,6 +107,7 @@
         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 @@
 		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 @@
 	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 @@
 	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;
 }
 
diff -r c7e1c71c5ec5 -r d72b4a74a992 src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Tue Sep 07 16:32:17 2010 +0100
+++ b/src/login-common/ssl-proxy-openssl.c	Tue Sep 07 17:19:40 2010 +0100
@@ -706,7 +706,7 @@
 
 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;
 


More information about the dovecot-cvs mailing list