# HG changeset patch # User Timo Sirainen # Date 1184293791 -10800 # Node ID 272796cfee668b5dbd942a32c91690b1acd82e51 # Parent 3e7364f200aa5aac9e6252c79e1edcb44d41d789 compiler warning fixes 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 @@ 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 @@ { #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 @@ #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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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); }