# HG changeset patch # User Timo Sirainen # Date 1198792807 -7200 # Node ID 7708a8c166d604aff12c2f0f101fb62bb23a0987 # Parent dcbf6afdf931c8a93ebfaf1990edcc2490922a32 Compiler warning fixes on 32bit systems. diff -r dcbf6afdf931 -r 7708a8c166d6 src/deliver/duplicate.c --- a/src/deliver/duplicate.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/deliver/duplicate.c Fri Dec 28 00:00:07 2007 +0200 @@ -130,7 +130,7 @@ return -1; } - if (hdr.stamp >= ioloop_time) { + if ((time_t)hdr.stamp >= ioloop_time) { /* still valid, save it */ struct duplicate *d; void *new_id; diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib-index/mail-cache-compress.c --- a/src/lib-index/mail-cache-compress.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib-index/mail-cache-compress.c Fri Dec 28 00:00:07 2007 +0200 @@ -206,7 +206,7 @@ used_fields_count = i; } else { for (i = used_fields_count = 0; i < orig_fields_count; i++) { - if (cache->fields[i].last_used < max_drop_time) + if ((time_t)cache->fields[i].last_used < max_drop_time) cache->fields[i].used = FALSE; ctx.field_file_map[i] = !cache->fields[i].used ? diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib-index/mail-cache-fields.c --- a/src/lib-index/mail-cache-fields.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib-index/mail-cache-fields.c Fri Dec 28 00:00:07 2007 +0200 @@ -256,7 +256,7 @@ const uint8_t *types, *decisions; const char *p, *names, *end; void *orig_key, *orig_value; - unsigned int new_fields_count; + unsigned int fidx, new_fields_count; time_t max_drop_time; uint32_t offset, i; @@ -337,12 +337,12 @@ if (hash_lookup_full(cache->field_name_hash, names, &orig_key, &orig_value)) { /* already exists, see if decision can be updated */ - field.idx = POINTER_CAST_TO(orig_value, unsigned int); - if (!cache->fields[field.idx].decision_dirty) { - cache->fields[field.idx].field.decision = + fidx = POINTER_CAST_TO(orig_value, unsigned int); + if (!cache->fields[fidx].decision_dirty) { + cache->fields[fidx].field.decision = decisions[i]; } - if (field_type_verify(cache, field.idx, + if (field_type_verify(cache, fidx, types[i], sizes[i]) < 0) return -1; } else { @@ -351,23 +351,24 @@ field.field_size = sizes[i]; field.decision = decisions[i]; mail_cache_register_fields(cache, &field, 1); + fidx = field.idx; } - if (cache->field_file_map[field.idx] != (uint32_t)-1) { + if (cache->field_file_map[fidx] != (uint32_t)-1) { mail_cache_set_corrupted(cache, "Duplicated field in header: %s", names); return -1; } - cache->fields[field.idx].used = TRUE; + cache->fields[fidx].used = TRUE; - cache->field_file_map[field.idx] = i; + cache->field_file_map[fidx] = i; cache->file_field_map[i] = field.idx; /* update last_used if it's newer than ours */ - if (last_used[i] > cache->fields[field.idx].last_used) - cache->fields[field.idx].last_used = last_used[i]; + if (last_used[i] > cache->fields[fidx].last_used) + cache->fields[fidx].last_used = last_used[i]; - if (cache->fields[field.idx].last_used < max_drop_time && - cache->fields[field.idx].last_used != 0) { + if ((time_t)cache->fields[fidx].last_used < max_drop_time && + cache->fields[fidx].last_used != 0) { /* time to drop this field. don't bother dropping fields that have never been used. */ cache->need_compress_file_seq = cache->hdr->file_seq; diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib-storage/index/dbox/dbox-sync.c --- a/src/lib-storage/index/dbox/dbox-sync.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib-storage/index/dbox/dbox-sync.c Fri Dec 28 00:00:07 2007 +0200 @@ -257,11 +257,11 @@ hdr = data; if (!close_flush_dirty_flags) { - if (hdr->last_dirty_flush_stamp < + if ((time_t)hdr->last_dirty_flush_stamp < ioloop_time - DBOX_FLUSH_SECS_IMMEDIATE) return 1; } else { - if (hdr->last_dirty_flush_stamp < + if ((time_t)hdr->last_dirty_flush_stamp < ioloop_time - DBOX_FLUSH_SECS_CLOSE) return 1; } diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib-storage/index/index-sort.c --- a/src/lib-storage/index/index-sort.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib-storage/index/index-sort.c Fri Dec 28 00:00:07 2007 +0200 @@ -189,7 +189,7 @@ i_assert(t != (time_t)-1); /* FIXME: truncation isn't good.. */ return t <= 0 ? 1 : - (t >= (uint32_t)-1 ? (uint32_t)-1 : t + 1); + ((uint64_t)t >= (uint32_t)-1 ? (uint32_t)-1 : (uint32_t)t + 1); } static uint32_t sort_get_date(struct mail *mail) @@ -205,7 +205,7 @@ i_assert(t != (time_t)-1); /* FIXME: truncation isn't good.. */ return t <= 0 ? 1 : - (t >= (uint32_t)-1 ? (uint32_t)-1 : t + 1); + ((uint64_t)t >= (uint32_t)-1 ? (uint32_t)-1 : (uint32_t)t + 1); } static uint32_t sort_get_size(struct mail *mail) diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib-storage/index/maildir/maildir-sync-index.c --- a/src/lib-storage/index/maildir/maildir-sync-index.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib-storage/index/maildir/maildir-sync-index.c Fri Dec 28 00:00:07 2007 +0200 @@ -519,7 +519,7 @@ "stat(%s) failed: %m", new_dir); return -1; } - if (rec->new_mtime != st.st_mtime) + if ((time_t)rec->new_mtime != st.st_mtime) return 1; /* check if cur/ changed */ @@ -529,7 +529,7 @@ "stat(%s) failed: %m", cur_dir); return -1; } - if (rec->cur_mtime != st.st_mtime) + if ((time_t)rec->cur_mtime != st.st_mtime) return 1; return 0; } diff -r dcbf6afdf931 -r 7708a8c166d6 src/lib/failures.c --- a/src/lib/failures.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/lib/failures.c Fri Dec 28 00:00:07 2007 +0200 @@ -87,7 +87,7 @@ struct io *io; ssize_t ret; - while ((ret = write(fd, data, len)) != len) { + while ((ret = write(fd, data, len)) != (ssize_t)len) { if (ret > 0) { /* some was written, continue.. */ data += ret; diff -r dcbf6afdf931 -r 7708a8c166d6 src/plugins/fts-squat/squat-trie.c --- a/src/plugins/fts-squat/squat-trie.c Thu Dec 27 22:56:25 2007 +0200 +++ b/src/plugins/fts-squat/squat-trie.c Fri Dec 28 00:00:07 2007 +0200 @@ -492,7 +492,7 @@ trie->data_size); } - if (end - data < len) { + if ((size_t)(end - data) < len) { squat_trie_set_corrupted(trie); return -1; } @@ -1094,7 +1094,8 @@ compress, &rebuild_ctx)) <= 0) return ret; - ctx->trie->hdr.indexid = I_MAX(ioloop_time, ctx->trie->hdr.indexid + 1); + ctx->trie->hdr.indexid = + I_MAX((unsigned int)ioloop_time, ctx->trie->hdr.indexid + 1); i_array_init(&uids, 1024); iter = squat_trie_iterate_uidlist_init(ctx->trie);