dovecot: compiler warning fixes

dovecot at dovecot.org dovecot at dovecot.org
Fri Jul 13 05:29:58 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/272796cfee66
changeset: 5983:272796cfee66
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 13 05:29:51 2007 +0300
description:
compiler warning fixes

diffstat:

8 files changed, 17 insertions(+), 14 deletions(-)
src/lib-index/mailbox-list-index-sync.c            |    1 +
src/lib-storage/index/maildir/maildir-sync-index.c |    2 +-
src/lib-storage/index/maildir/maildir-sync.c       |    6 +++---
src/lib-storage/index/maildir/maildir-uidlist.c    |    2 +-
src/lib-storage/mailbox-list.c                     |    3 ++-
src/plugins/acl/acl-backend-vfile-acllist.c        |    3 ++-
src/plugins/acl/acl-backend-vfile.c                |    4 ++--
src/util/idxview.c                                 |   10 +++++-----

diffs (155 lines):

diff -r 3e7364f200aa -r 272796cfee66 src/lib-index/mailbox-list-index-sync.c
--- a/src/lib-index/mailbox-list-index-sync.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/lib-index/mailbox-list-index-sync.c	Fri Jul 13 05:29:51 2007 +0300
@@ -7,6 +7,7 @@
 #include "file-cache.h"
 #include "file-set-size.h"
 #include "mmap-util.h"
+#include "nfs-workarounds.h"
 #include "ostream.h"
 #include "mail-index-private.h"
 #include "mailbox-list-index-private.h"
diff -r 3e7364f200aa -r 272796cfee66 src/lib-storage/index/maildir/maildir-sync-index.c
--- a/src/lib-storage/index/maildir/maildir-sync-index.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-sync-index.c	Fri Jul 13 05:29:51 2007 +0300
@@ -452,7 +452,7 @@ int maildir_sync_index(struct maildir_in
 
 	if (uid_validity == 0) {
 		uid_validity = hdr->uid_validity != 0 ?
-			hdr->uid_validity : ioloop_time;
+			hdr->uid_validity : (uint32_t)ioloop_time;
 		maildir_uidlist_set_uid_validity(mbox->uidlist, uid_validity);
 	}
 	maildir_uidlist_set_next_uid(mbox->uidlist, hdr_next_uid, FALSE);
diff -r 3e7364f200aa -r 272796cfee66 src/lib-storage/index/maildir/maildir-sync.c
--- a/src/lib-storage/index/maildir/maildir-sync.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-sync.c	Fri Jul 13 05:29:51 2007 +0300
@@ -550,7 +550,7 @@ static int maildir_sync_quick_check(stru
 {
 #ifdef HAVE_STAT_TV_NSEC
 #  define DIR_NSECS_CHANGED(st, hdr, name) \
-	((st).st_mtim.tv_nsec != (hdr)->name ## _mtime_nsecs)
+	((unsigned int)(st).st_mtim.tv_nsec != (hdr)->name ## _mtime_nsecs)
 #else
 #  define DIR_NSECS_CHANGED(st, hdr, name) 0
 #endif
@@ -558,10 +558,10 @@ static int maildir_sync_quick_check(stru
 #define DIR_DELAYED_REFRESH(hdr, name) \
 	((hdr)->name ## _check_time <= \
 		(hdr)->name ## _mtime + MAILDIR_SYNC_SECS && \
-	 (hdr)->name ## _check_time < ioloop_time - MAILDIR_SYNC_SECS)
+	 (time_t)(hdr)->name ## _check_time < ioloop_time - MAILDIR_SYNC_SECS)
 
 #define DIR_MTIME_CHANGED(st, hdr, name) \
-	((st).st_mtime != (hdr)->name ## _mtime || \
+	((st).st_mtime != (time_t)(hdr)->name ## _mtime || \
 	 DIR_NSECS_CHANGED(st, hdr, name))
 
 	struct maildir_index_header *hdr = &mbox->maildir_hdr;
diff -r 3e7364f200aa -r 272796cfee66 src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Jul 13 05:29:51 2007 +0300
@@ -975,7 +975,7 @@ static int maildir_uidlist_sync_update(s
 
 		hdr = mail_index_get_header(uidlist->mbox->ibox.view);
 		uidlist->uid_validity = hdr->uid_validity != 0 ?
-			hdr->uid_validity : ioloop_time;
+			hdr->uid_validity : (uint32_t)ioloop_time;
 	}
 
 	if (ctx->uidlist->recreate || uidlist->fd == -1 ||
diff -r 3e7364f200aa -r 272796cfee66 src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/lib-storage/mailbox-list.c	Fri Jul 13 05:29:51 2007 +0300
@@ -391,7 +391,8 @@ bool mailbox_list_name_is_too_large(cons
 	return FALSE;
 }
 
-enum mailbox_list_file_type mailbox_list_get_file_type(const struct dirent *d)
+enum mailbox_list_file_type
+mailbox_list_get_file_type(const struct dirent *d __attr_unused__)
 {
 	enum mailbox_list_file_type type;
 
diff -r 3e7364f200aa -r 272796cfee66 src/plugins/acl/acl-backend-vfile-acllist.c
--- a/src/plugins/acl/acl-backend-vfile-acllist.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/plugins/acl/acl-backend-vfile-acllist.c	Fri Jul 13 05:29:51 2007 +0300
@@ -109,7 +109,8 @@ static int acl_backend_vfile_acllist_rea
 
 void acl_backend_vfile_acllist_refresh(struct acl_backend_vfile *backend)
 {
-	if (backend->acllist_last_check + backend->cache_secs > ioloop_time)
+	if (backend->acllist_last_check +
+	    (time_t)backend->cache_secs > ioloop_time)
 		return;
 
 	if (acl_backend_vfile_acllist_read(backend) < 0) {
diff -r 3e7364f200aa -r 272796cfee66 src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/plugins/acl/acl-backend-vfile.c	Fri Jul 13 05:29:51 2007 +0300
@@ -442,7 +442,7 @@ acl_backend_vfile_refresh(struct acl_obj
 	if (validity == NULL)
 		return 1;
 	if (path == NULL ||
-	    validity->last_check + backend->cache_secs > ioloop_time)
+	    validity->last_check + (time_t)backend->cache_secs > ioloop_time)
 		return 0;
 
 	validity->last_check = ioloop_time;
@@ -464,7 +464,7 @@ acl_backend_vfile_refresh(struct acl_obj
 		   do it only after a couple of seconds so we don't
 		   keep re-reading it all the time within those
 		   seconds) */
-		unsigned int cache_secs = backend->cache_secs;
+		time_t cache_secs = backend->cache_secs;
 
 		if (st.st_mtime < validity->last_read_time - cache_secs ||
 		    ioloop_time - validity->last_read_time <= cache_secs)
diff -r 3e7364f200aa -r 272796cfee66 src/util/idxview.c
--- a/src/util/idxview.c	Fri Jul 13 05:22:16 2007 +0300
+++ b/src/util/idxview.c	Fri Jul 13 05:29:51 2007 +0300
@@ -91,7 +91,7 @@ static void dump_hdr(int fd)
 
 	base = i_malloc(hdr.header_size);
 	ret = pread(fd, base, hdr.header_size, 0);
-	if (ret != hdr.header_size) {
+	if (ret != (ssize_t)hdr.header_size) {
 		i_fatal("file hdr read() %"PRIuSIZE_T" != %u",
 			ret, hdr.header_size);
 	}
@@ -181,7 +181,7 @@ static void dump_cache_hdr(int fd)
 
 	buf = i_malloc(fields.size);
 	ret = pread(fd, buf, fields.size, field_offset);
-	if (ret != fields.size) {
+	if (ret != (ssize_t)fields.size) {
 		i_fatal("cache file fields read() %"PRIuSIZE_T" != %u",
 			ret, fields.size);
 	}
@@ -196,7 +196,7 @@ static void dump_cache_hdr(int fd)
 	decision = CONST_PTR_OFFSET(buf, MAIL_CACHE_FIELD_DECISION(fields.fields_count));
 	names = CONST_PTR_OFFSET(buf, MAIL_CACHE_FIELD_NAMES(fields.fields_count));
 
-	if (names - (const char *)buf >= fields.size)
+	if ((unsigned int)(names - (const char *)buf) >= fields.size)
 		i_fatal("Fields go outside allocated size");
 
 	i_array_init(&cache_fields, 64);
@@ -245,7 +245,7 @@ static void dump_cache(uint32_t offset)
 
 	buf = t_malloc(rec.size);
 	ret = pread(cache_fd, buf, rec.size, offset);
-	if (ret != rec.size)
+	if (ret != (ssize_t)rec.size)
 		i_fatal("cache rec read() %"PRIuSIZE_T" != %u", ret, rec.size);
 	printf(" - cache at %u + %u (prev_offset = %u)\n",
 	       offset, rec.size, rec.prev_offset);
@@ -347,7 +347,7 @@ static int dump_record(int fd, void *buf
 	if (ret == 0)
 		return 0;
 
-	if (ret != hdr.record_size) {
+	if (ret != (ssize_t)hdr.record_size) {
 		i_fatal("rec hdr read() %"PRIuSIZE_T" != %u",
 			ret, hdr.record_size);
 	}


More information about the dovecot-cvs mailing list