dovecot-1.1: Compiler/sparse warning fixes.

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 20 21:00:41 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/adb5be74149d
changeset: 7772:adb5be74149d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 20 20:50:45 2008 +0300
description:
Compiler/sparse warning fixes.

diffstat:

8 files changed, 10 insertions(+), 8 deletions(-)
src/imap/cmd-append.c                           |    2 +-
src/imap/imap-sync.c                            |    2 +-
src/imap/imap-thread.c                          |    2 +-
src/lib-sql/driver-sqlite.c                     |    2 +-
src/lib-storage/index/maildir/maildir-uidlist.c |    2 +-
src/lib-storage/mail-storage.c                  |    2 +-
src/lib/array-decl.h                            |    2 +-
src/util/idxview.c                              |    4 +++-

diffs (99 lines):

diff -r a852c378bf5a -r adb5be74149d src/imap/cmd-append.c
--- a/src/imap/cmd-append.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/imap/cmd-append.c	Sun Jul 20 20:50:45 2008 +0300
@@ -329,7 +329,7 @@ static bool cmd_append_continue_parsing(
 	ctx->input = i_stream_create_limit(client->input, ctx->msg_size);
 	ret = mailbox_save_init(ctx->t, flags, keywords,
 				internal_date, timezone_offset, NULL,
-				ctx->input, FALSE, &ctx->save_ctx);
+				ctx->input, NULL, &ctx->save_ctx);
 
 	if (keywords != NULL)
 		mailbox_keywords_free(ctx->box, &keywords);
diff -r a852c378bf5a -r adb5be74149d src/imap/imap-sync.c
--- a/src/imap/imap-sync.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/imap/imap-sync.c	Sun Jul 20 20:50:45 2008 +0300
@@ -52,7 +52,7 @@ imap_sync_init(struct client *client, st
 
 	ctx->sync_ctx = mailbox_sync_init(box, flags);
 	ctx->t = mailbox_transaction_begin(box, 0);
-	ctx->mail = mail_alloc(ctx->t, MAIL_FETCH_FLAGS, 0);
+	ctx->mail = mail_alloc(ctx->t, MAIL_FETCH_FLAGS, NULL);
 	ctx->messages_count = client->messages_count;
 	i_array_init(&ctx->tmp_keywords, client->keywords.announce_count + 8);
 
diff -r a852c378bf5a -r adb5be74149d src/imap/imap-thread.c
--- a/src/imap/imap-thread.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/imap/imap-thread.c	Sun Jul 20 20:50:45 2008 +0300
@@ -572,7 +572,7 @@ static struct node *sort_nodes(struct no
 		tail = NULL;
 
 		nmerges = 0;  /* count number of merges we do in this pass */
-		while (p != 0) {
+		while (p != NULL) {
 			nmerges++;  /* there exists a merge to be done */
 
 			/* step `insize' places along from p */
diff -r a852c378bf5a -r adb5be74149d src/lib-sql/driver-sqlite.c
--- a/src/lib-sql/driver-sqlite.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/lib-sql/driver-sqlite.c	Sun Jul 20 20:50:45 2008 +0300
@@ -124,7 +124,7 @@ static void driver_sqlite_exec(struct sq
 {
 	struct sqlite_db *db = (struct sqlite_db *)_db;
 
-	db->rc = sqlite3_exec(db->sqlite, query, NULL, 0, NULL);
+	db->rc = sqlite3_exec(db->sqlite, query, NULL, NULL, NULL);
 	if (db->rc != SQLITE_OK) {
 		i_error("sqlite: exec(%s) failed: %s (%d)",
 			query, sqlite3_errmsg(db->sqlite), db->rc);
diff -r a852c378bf5a -r adb5be74149d src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Sun Jul 20 20:50:45 2008 +0300
@@ -788,7 +788,7 @@ int maildir_uidlist_refresh_fast_init(st
 	if ((ret = maildir_uidlist_stat(uidlist, &st)) < 0)
 		return ret;
 
-	if (st.st_size == mhdr->uidlist_size &&
+	if ((uoff_t)st.st_size == mhdr->uidlist_size &&
 	    st.st_mtime == (time_t)mhdr->uidlist_mtime &&
 	    ST_NTIMES_EQUAL(ST_MTIME_NSEC(st), mhdr->uidlist_mtime_nsecs)) {
 		/* index is up-to-date */
diff -r a852c378bf5a -r adb5be74149d src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/lib-storage/mail-storage.c	Sun Jul 20 20:50:45 2008 +0300
@@ -172,7 +172,7 @@ int mail_storage_create(struct mail_name
 			enum file_lock_method lock_method,
 			const char **error_r)
 {
-	struct mail_storage *storage_class, *storage;
+	struct mail_storage *storage_class, *storage = NULL;
 	struct mail_storage *const *classes;
 	const char *home, *value;
 	unsigned int i, count;
diff -r a852c378bf5a -r adb5be74149d src/lib/array-decl.h
--- a/src/lib/array-decl.h	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/lib/array-decl.h	Sun Jul 20 20:50:45 2008 +0300
@@ -2,7 +2,7 @@
 #define ARRAY_DECL_H
 
 #define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; } name
-#define ARRAY_INIT { { 0, 0 } }
+#define ARRAY_INIT { { NULL, 0 } }
 
 #define ARRAY_DEFINE_TYPE(name, array_type) \
 	union array ## __ ## name { struct array arr; array_type const *const *v; array_type **v_modifiable; }
diff -r a852c378bf5a -r adb5be74149d src/util/idxview.c
--- a/src/util/idxview.c	Sun Jul 20 20:29:37 2008 +0300
+++ b/src/util/idxview.c	Sun Jul 20 20:50:45 2008 +0300
@@ -116,8 +116,10 @@ static void dump_extensions(struct mail_
 
 	if (array_is_created(&index->map->extensions))
 		extensions = array_get(&index->map->extensions, &count);
-	else
+	else {
+		extensions = NULL;
 		count = 0;
+	}
 	if (count == 0) {
 		printf("no extensions\n");
 		return;


More information about the dovecot-cvs mailing list