changeset 11039:0f98525e4567 HEAD

Removed dead code.
author Timo Sirainen <tss@iki.fi>
date Mon, 05 Apr 2010 01:06:02 +0300
parents f72884695084
children c88e1b2658a8
files src/auth/auth-master-connection.c src/auth/auth-request-handler.c src/config/old-set-parser.c src/dict/dict-commands.c src/doveadm/doveadm-dump-log.c src/imap/cmd-close.c src/imap/cmd-list.c src/imap/cmd-select.c src/imap/cmd-sort.c src/imap/cmd-unselect.c src/lda/main.c src/lib-imap/imap-match.c src/lib-index/mail-cache-transaction.c src/lib-index/mail-index-sync-ext.c src/lib-index/mail-index-sync-update.c src/lib-index/mail-index-view-sync.c src/lib-index/mail-index-view.c src/lib-index/mail-transaction-log-file.c src/lib-lda/mail-send.c src/lib-mail/message-header-decode.c src/lib-mail/message-header-parser.c src/lib-mail/test-istream-header-filter.c src/lib-storage/index/cydir/cydir-save.c src/lib-storage/index/dbox-common/dbox-file-fix.c src/lib-storage/index/dbox-multi/mdbox-file.c src/lib-storage/index/index-mail.c src/lib-storage/index/index-thread.c src/lib-storage/index/maildir/maildir-save.c src/lib-storage/index/maildir/maildir-storage.h src/lib-storage/index/maildir/maildir-sync.c src/lib-storage/index/mbox/istream-raw-mbox.c src/lib-storage/index/mbox/mbox-lock.c src/lib-storage/index/mbox/mbox-save.c src/lib-storage/index/mbox/mbox-sync-update.c src/lib-storage/list/mailbox-list-fs.c src/lib-storage/mail-storage-service.c src/lib/askpass.c src/lib/file-cache.c src/lib/file-dotlock.c src/lib/home-expand.c src/lib/istream-tee.c src/lib/seq-range-array.c src/lib/strescape.c src/lib/strfuncs.c src/login-common/client-common-auth.c src/login-common/ssl-proxy-openssl.c src/master/main.c src/plugins/fts-squat/squat-trie.c src/plugins/lazy-expunge/lazy-expunge-plugin.c src/pop3/pop3-client.c src/util/maildirlock.c
diffstat 51 files changed, 71 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-master-connection.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/auth/auth-master-connection.c	Mon Apr 05 01:06:02 2010 +0300
@@ -464,9 +464,7 @@
 
 static int master_output(struct auth_master_connection *conn)
 {
-	int ret;
-
-	if ((ret = o_stream_flush(conn->output)) < 0) {
+	if (o_stream_flush(conn->output) < 0) {
 		/* transmit error, probably master died */
 		auth_master_connection_destroy(&conn);
 		return 1;
--- a/src/auth/auth-request-handler.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/auth/auth-request-handler.c	Mon Apr 05 01:06:02 2010 +0300
@@ -103,7 +103,7 @@
 				    struct auth_stream_reply *reply)
 {
 	const char **fields, *extra_fields;
-	unsigned int src, dest;
+	unsigned int src;
 	bool seen_pass = FALSE;
 
 	if (auth_stream_is_empty(request->extra_fields))
@@ -120,7 +120,7 @@
 	}
 
 	fields = t_strsplit(extra_fields, "\t");
-	for (src = dest = 0; fields[src] != NULL; src++) {
+	for (src = 0; fields[src] != NULL; src++) {
 		if (strncmp(fields[src], "userdb_", 7) != 0) {
 			if (!seen_pass && strncmp(fields[src], "pass=", 5) == 0)
 				seen_pass = TRUE;
--- a/src/config/old-set-parser.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/config/old-set-parser.c	Mon Apr 05 01:06:02 2010 +0300
@@ -202,9 +202,9 @@
 
 static bool listen_has_port(const char *str)
 {
-	const char *p, *const *addrs;
+	const char *const *addrs;
 
-	if ((p = strchr(str, ':')) == NULL)
+	if (strchr(str, ':') == NULL)
 		return FALSE;
 
 	addrs = t_strsplit_spaces(str, ", ");
--- a/src/dict/dict-commands.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/dict/dict-commands.c	Mon Apr 05 01:06:02 2010 +0300
@@ -48,7 +48,6 @@
 {
 	string_t *str;
 	const char *key, *value;
-	int ret;
 
 	str = t_str_new(256);
 	o_stream_cork(conn->output);
@@ -73,7 +72,7 @@
 	o_stream_unset_flush_callback(conn->output);
 
 	str_truncate(str, 0);
-	if ((ret = dict_iterate_deinit(&conn->iter_ctx)) < 0)
+	if (dict_iterate_deinit(&conn->iter_ctx) < 0)
 		str_append_c(str, DICT_PROTOCOL_REPLY_FAIL);
 	str_append_c(str, '\n');
 	o_stream_send(conn->output, str_data(str), str_len(str));
--- a/src/doveadm/doveadm-dump-log.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/doveadm/doveadm-dump-log.c	Mon Apr 05 01:06:02 2010 +0300
@@ -397,7 +397,7 @@
 		break;
 	}
 	case MAIL_TRANSACTION_UID_UPDATE: {
-		const struct mail_transaction_uid_update *rec = data, *end;
+		const struct mail_transaction_uid_update *rec, *end;
 
 		end = CONST_PTR_OFFSET(data, size);
 		for (rec = data; rec < end; rec++) {
@@ -407,7 +407,7 @@
 		break;
 	}
 	case MAIL_TRANSACTION_MODSEQ_UPDATE: {
-		const struct mail_transaction_modseq_update *rec = data, *end;
+		const struct mail_transaction_modseq_update *rec, *end;
 
 		end = CONST_PTR_OFFSET(data, size);
 		for (rec = data; rec < end; rec++) {
--- a/src/imap/cmd-close.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/imap/cmd-close.c	Mon Apr 05 01:06:02 2010 +0300
@@ -9,7 +9,6 @@
 	struct client *client = cmd->client;
 	struct mailbox *mailbox = client->mailbox;
 	struct mail_storage *storage;
-	int ret;
 
 	if (!client_verify_open_mailbox(cmd))
 		return TRUE;
@@ -18,7 +17,7 @@
 	client->mailbox = NULL;
 
 	storage = mailbox_get_storage(mailbox);
-	if ((ret = imap_expunge(mailbox, NULL)) < 0)
+	if (imap_expunge(mailbox, NULL) < 0)
 		client_send_untagged_storage_error(client, storage);
 	if (mailbox_sync(mailbox, 0) < 0)
 		client_send_untagged_storage_error(client, storage);
--- a/src/imap/cmd-list.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/imap/cmd-list.c	Mon Apr 05 01:06:02 2010 +0300
@@ -358,12 +358,11 @@
 	const struct mailbox_info *info;
 	struct mail_namespace *ns;
 	enum mailbox_info_flags flags;
-	string_t *str, *name_str;
+	string_t *str;
 	const char *name;
 	int ret = 0;
 
 	str = t_str_new(256);
-	name_str = t_str_new(256);
 	while ((info = mailbox_list_iter_next(ctx->list_iter)) != NULL) {
 		name = info->name;
 		flags = info->flags;
--- a/src/imap/cmd-select.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/imap/cmd-select.c	Mon Apr 05 01:06:02 2010 +0300
@@ -30,13 +30,12 @@
 				   const ARRAY_TYPE(seq_range) *seqset,
 				   const ARRAY_TYPE(seq_range) *uidset)
 {
-	const struct seq_range *seq_range, *uid_range;
+	const struct seq_range *uid_range;
 	struct seq_range_iter seq_iter;
-	unsigned int i, seq_count, uid_count, diff, n = 0;
+	unsigned int i, uid_count, diff, n = 0;
 	uint32_t seq;
 
 	/* change all n:m ranges to n,m and store the results */
-	seq_range = array_get(seqset, &seq_count);
 	uid_range = array_get(uidset, &uid_count);
 
 	seq_range_array_iter_init(&seq_iter, seqset);
@@ -200,9 +199,8 @@
 static bool cmd_select_continue(struct client_command_context *cmd)
 {
         struct imap_select_context *ctx = cmd->context;
-	int ret;
 
-	if ((ret = imap_fetch_more(ctx->fetch_ctx)) == 0) {
+	if (imap_fetch_more(ctx->fetch_ctx) == 0) {
 		/* unfinished */
 		return FALSE;
 	}
--- a/src/imap/cmd-sort.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/imap/cmd-sort.c	Mon Apr 05 01:06:02 2010 +0300
@@ -78,7 +78,7 @@
 		client_send_command_error(cmd, "Sort list ends with REVERSE.");
 		return -1;
 	}
-	program[pos++] = MAIL_SORT_END;
+	program[pos] = MAIL_SORT_END;
 
 	if (args->type != IMAP_ARG_EOL) {
 		client_send_command_error(cmd,
--- a/src/imap/cmd-unselect.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/imap/cmd-unselect.c	Mon Apr 05 01:06:02 2010 +0300
@@ -7,7 +7,6 @@
 {
 	struct client *client = cmd->client;
 	struct mailbox *mailbox = client->mailbox;
-	struct mail_storage *storage;
 
 	if (!client_verify_open_mailbox(cmd))
 		return TRUE;
@@ -17,7 +16,6 @@
 	i_assert(client->mailbox_change_lock == NULL);
 	client->mailbox = NULL;
 
-	storage = mailbox_get_storage(mailbox);
 	mailbox_free(&mailbox);
 	client_update_mailbox_flags(client, NULL);
 
--- a/src/lda/main.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lda/main.c	Mon Apr 05 01:06:02 2010 +0300
@@ -167,7 +167,7 @@
 	if (ret > 0 && size >= 5 && memcmp(data, "From ", 5) == 0) {
 		/* skip until the first LF */
 		i_stream_skip(input, 5);
-		while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
+		while (i_stream_read_data(input, &data, &size, 0) > 0) {
 			for (i = 0; i < size; i++) {
 				if (data[i] == '\n')
 					break;
--- a/src/lib-imap/imap-match.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-imap/imap-match.c	Mon Apr 05 01:06:02 2010 +0300
@@ -69,7 +69,7 @@
 			*dest++ = *pattern++;
 		}
 	}
-	*dest++ = '\0';
+	*dest = '\0';
 	return ret;
 }
 
--- a/src/lib-index/mail-cache-transaction.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-cache-transaction.c	Mon Apr 05 01:06:02 2010 +0300
@@ -884,7 +884,7 @@
 	struct mail_cache *cache = ctx->cache;
 	int ret;
 
-	if ((ret = mail_cache_transaction_lock(ctx)) <= 0) {
+	if (mail_cache_transaction_lock(ctx) <= 0) {
 		if (MAIL_CACHE_IS_UNUSABLE(cache))
 			return -1;
 
@@ -895,7 +895,7 @@
 			return 0;
 
 		/* need to add it */
-		if ((ret = mail_cache_transaction_lock(ctx)) <= 0)
+		if (mail_cache_transaction_lock(ctx) <= 0)
 			return -1;
 	}
 
--- a/src/lib-index/mail-index-sync-ext.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-index-sync-ext.c	Mon Apr 05 01:06:02 2010 +0300
@@ -338,7 +338,7 @@
 		sync_ext_reorder(map, ext_map_idx, old_record_size);
 	} else if (modified) {
 		/* header size changed. recreate index file. */
-		map = mail_index_sync_get_atomic_map(ctx);
+		(void)mail_index_sync_get_atomic_map(ctx);
 	}
 }
 
@@ -372,7 +372,7 @@
 			     const struct mail_index_ext_header *ext_hdr,
 			     uint32_t *ext_map_idx_r)
 {
-	struct mail_index_map *map = ctx->view->map;
+	struct mail_index_map *map;
 	const struct mail_index_ext *ext;
 	buffer_t *hdr_buf;
 	uint32_t ext_map_idx;
@@ -573,7 +573,7 @@
 int mail_index_sync_ext_reset(struct mail_index_sync_map_ctx *ctx,
 			      const struct mail_transaction_ext_reset *u)
 {
-	struct mail_index_map *map = ctx->view->map;
+	struct mail_index_map *map;
 	struct mail_index_ext_header *ext_hdr;
         struct mail_index_ext *ext;
 
--- a/src/lib-index/mail-index-sync-update.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Mon Apr 05 01:06:02 2010 +0300
@@ -237,7 +237,7 @@
 static void
 sync_expunge(struct mail_index_sync_map_ctx *ctx, uint32_t uid1, uint32_t uid2)
 {
-	struct mail_index_map *map = ctx->view->map;
+	struct mail_index_map *map;
 	struct mail_index_record *rec;
 	uint32_t seq_count, seq, seq1, seq2;
 
@@ -673,7 +673,7 @@
 		break;
 	}
 	case MAIL_TRANSACTION_EXT_HDR_UPDATE: {
-		const struct mail_transaction_ext_hdr_update *rec = data;
+		const struct mail_transaction_ext_hdr_update *rec;
 		unsigned int i;
 
 		for (i = 0; i < hdr->size; ) {
@@ -699,7 +699,7 @@
 		break;
 	}
 	case MAIL_TRANSACTION_EXT_HDR_UPDATE32: {
-		const struct mail_transaction_ext_hdr_update32 *rec = data;
+		const struct mail_transaction_ext_hdr_update32 *rec;
 		unsigned int i;
 
 		for (i = 0; i < hdr->size; ) {
@@ -779,7 +779,6 @@
 			break;
 		}
 
-		rec = data;
 		end = CONST_PTR_OFFSET(data, hdr->size);
 		for (rec = data; rec < end; rec++) {
 			ret = mail_index_sync_ext_atomic_inc(ctx, rec);
@@ -801,7 +800,7 @@
 		break;
 	}
 	case MAIL_TRANSACTION_UID_UPDATE: {
-		const struct mail_transaction_uid_update *rec = data, *end;
+		const struct mail_transaction_uid_update *rec, *end;
 
 		end = CONST_PTR_OFFSET(data, hdr->size);
 		for (rec = data; rec < end; rec++)
--- a/src/lib-index/mail-index-view-sync.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-index-view-sync.c	Mon Apr 05 01:06:02 2010 +0300
@@ -511,7 +511,7 @@
 			   enum mail_index_view_sync_flags flags)
 {
 	struct mail_index_view_sync_ctx *ctx;
-	struct mail_index_map *map;
+	struct mail_index_map *tmp_map;
 	unsigned int expunge_count = 0;
 	bool reset, sync_expunges, have_expunges;
 	int ret;
@@ -613,11 +613,9 @@
 		ctx->sync_map_update = TRUE;
 
 		if (view->map->refcount > 1) {
-			map = mail_index_map_clone(view->map);
+			tmp_map = mail_index_map_clone(view->map);
 			mail_index_unmap(&view->map);
-			view->map = map;
-		} else {
-			map = view->map;
+			view->map = tmp_map;
 		}
 
 		if (sync_expunges) {
--- a/src/lib-index/mail-index-view.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-index-view.c	Mon Apr 05 01:06:02 2010 +0300
@@ -278,7 +278,7 @@
 		return;
 
 	keyword_idx_map = array_get(&map->keyword_idx_map, &keyword_count);
-	for (i = 0, idx = 0; i < record_size; i++) {
+	for (i = 0; i < record_size; i++) {
 		/* first do the quick check to see if there's keywords at all */
 		if (data[i] == 0)
 			continue;
--- a/src/lib-index/mail-transaction-log-file.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-index/mail-transaction-log-file.c	Mon Apr 05 01:06:02 2010 +0300
@@ -845,7 +845,7 @@
 		*cur_modseq += 1;
 		break;
 	case MAIL_TRANSACTION_MODSEQ_UPDATE: {
-		const struct mail_transaction_modseq_update *rec = data, *end;
+		const struct mail_transaction_modseq_update *rec, *end;
 
 		end = CONST_PTR_OFFSET(data, trans_size - sizeof(*hdr));
 		for (rec = data; rec < end; rec++) {
--- a/src/lib-lda/mail-send.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-lda/mail-send.c	Mon Apr 05 01:06:02 2010 +0300
@@ -181,7 +181,6 @@
     const unsigned char *data;
     const char *return_path;
     size_t size;
-    int ret;
 
     if (mail_get_stream(ctx->src_mail, NULL, NULL, &input) < 0)
 	    return -1;
@@ -199,7 +198,7 @@
                                           N_ELEMENTS(hide_headers),
 					  null_header_filter_callback, NULL);
 
-    while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
+    while (i_stream_read_data(input, &data, &size, 0) > 0) {
 	    if (fwrite(data, size, 1, f) == 0)
 		    break;
 	    i_stream_skip(input, size);
--- a/src/lib-mail/message-header-decode.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-mail/message-header-decode.c	Mon Apr 05 01:06:02 2010 +0300
@@ -77,7 +77,7 @@
 	size_t pos, start_pos, ret;
 
 	/* =?charset?Q|B?text?= */
-	start_pos = pos = 0;
+	start_pos = 0;
 	for (pos = 0; pos + 1 < size; ) {
 		if (data[pos] != '=' || data[pos+1] != '?') {
 			pos++;
--- a/src/lib-mail/message-header-parser.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-mail/message-header-parser.c	Mon Apr 05 01:06:02 2010 +0300
@@ -57,7 +57,7 @@
 {
         struct message_header_line *line = &ctx->line;
 	const unsigned char *msg;
-	size_t i, size, startpos, colon_pos, parse_size, value_pos;
+	size_t i, size, startpos, colon_pos, parse_size;
 	int ret;
 	bool continued, continues, last_no_newline, last_crlf;
 	bool no_newline, crlf_newline;
@@ -342,7 +342,6 @@
 				buffer_append_c(ctx->value_buf, '\r');
 			buffer_append_c(ctx->value_buf, '\n');
 		}
-		value_pos = ctx->value_buf->used;
 		if ((ctx->flags & MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE) &&
 		    line->value_len > 0 && line->value[0] != ' ' &&
 		    IS_LWSP(line->value[0])) {
--- a/src/lib-mail/test-istream-header-filter.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-mail/test-istream-header-filter.c	Mon Apr 05 01:06:02 2010 +0300
@@ -25,7 +25,6 @@
 	unsigned int output_len = strlen(output);
 	const unsigned char *data;
 	size_t size;
-	ssize_t ret;
 
 	test_begin("i_stream_create_header_filter()");
 	istream = test_istream_create(input);
@@ -55,7 +54,7 @@
 
 	i_stream_skip(filter, size);
 	i_stream_seek(filter, 0);
-	while ((ret = i_stream_read(filter)) > 0) ;
+	while (i_stream_read(filter) > 0) ;
 	data = i_stream_get_data(filter, &size);
 	test_assert(size == output_len && memcmp(data, output, size) == 0);
 
--- a/src/lib-storage/index/cydir/cydir-save.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/cydir/cydir-save.c	Mon Apr 05 01:06:02 2010 +0300
@@ -59,8 +59,7 @@
 cydir_save_alloc(struct mailbox_transaction_context *t)
 {
 	struct cydir_mailbox *mbox = (struct cydir_mailbox *)t->box;
-	struct cydir_save_context *ctx =
-		(struct cydir_save_context *)t->save_ctx;
+	struct cydir_save_context *ctx;
 
 	i_assert((t->flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
 
--- a/src/lib-storage/index/dbox-common/dbox-file-fix.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/dbox-common/dbox-file-fix.c	Mon Apr 05 01:06:02 2010 +0300
@@ -36,7 +36,6 @@
 	orig_offset = input->v_offset;
 	while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
 		pre_offset = (uoff_t)-1;
-		post_offset = (uoff_t)-1;
 		if (str_find_more(pre_ctx, data, size)) {
 			pre_offset = input->v_offset +
 				str_find_get_match_end_pos(pre_ctx) -
@@ -292,16 +291,15 @@
 int dbox_file_fix(struct dbox_file *file, uoff_t start_offset)
 {
 	struct ostream *output;
-	const char *dir, *fname, *temp_path, *broken_path;
+	const char *dir, *p, *temp_path, *broken_path;
 	bool deleted;
 	int fd, ret;
 
 	i_assert(dbox_file_is_open(file));
 
-	fname = strrchr(file->cur_path, '/');
-	i_assert(fname != NULL);
-	dir = t_strdup_until(file->cur_path, fname);
-	fname++;
+	p = strrchr(file->cur_path, '/');
+	i_assert(p != NULL);
+	dir = t_strdup_until(file->cur_path, p);
 
 	temp_path = t_strdup_printf("%s/%s", dir, dbox_generate_tmp_filename());
 	fd = file->storage->v.file_create_fd(file, temp_path, FALSE);
--- a/src/lib-storage/index/dbox-multi/mdbox-file.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-file.c	Mon Apr 05 01:06:02 2010 +0300
@@ -232,7 +232,7 @@
 void mdbox_file_unrefed(struct dbox_file *file)
 {
 	struct mdbox_file *mfile = (struct mdbox_file *)file;
-	struct mdbox_file *const *files, *oldest_file;
+	struct mdbox_file *oldest_file;
 	unsigned int i, count;
 
 	/* don't cache metadata seeks while file isn't being referenced */
@@ -240,7 +240,7 @@
 	mfile->close_time = ioloop_time;
 
 	if (mfile->file_id != 0) {
-		files = array_get(&mfile->storage->open_files, &count);
+		count = array_count(&mfile->storage->open_files);
 		if (!file->deleted && count <= MDBOX_MAX_OPEN_UNUSED_FILES) {
 			/* we can leave this file open for now */
 			mdbox_file_close_later(mfile);
--- a/src/lib-storage/index/index-mail.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/index-mail.c	Mon Apr 05 01:06:02 2010 +0300
@@ -1369,10 +1369,9 @@
 {
 	struct index_mail *mail = (struct index_mail *)_mail;
 	struct message_block block;
-	int ret;
 
-	while ((ret = message_parser_parse_next_block(mail->data.parser_ctx,
-						      &block)) > 0) {
+	while (message_parser_parse_next_block(mail->data.parser_ctx,
+					       &block) > 0) {
 		if (block.size != 0)
 			continue;
 
--- a/src/lib-storage/index/index-thread.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/index-thread.c	Mon Apr 05 01:06:02 2010 +0300
@@ -208,7 +208,6 @@
 	   pointers though. */
 	new_first_invalid = new_count + 1 +
 		THREAD_INVALID_MSGID_STR_IDX_SKIP_COUNT;
-	i = cache->first_invalid_msgid_str_idx;
 	for (i = 0; i < invalid_count; i++) {
 		node = array_idx_modifiable(&new_nodes, new_first_invalid + i);
 		*node = old_nodes[cache->first_invalid_msgid_str_idx + i];
--- a/src/lib-storage/index/maildir/maildir-save.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/maildir/maildir-save.c	Mon Apr 05 01:06:02 2010 +0300
@@ -140,9 +140,8 @@
 	return &ctx->ctx;
 }
 
-struct maildir_filename *
-maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
-		 bool preserve_filename)
+void maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
+		      bool preserve_filename)
 {
 	struct maildir_save_context *ctx = (struct maildir_save_context *)_ctx;
 	struct maildir_filename *mf;
@@ -222,7 +221,6 @@
 		ctx->input = input;
 		ctx->cur_dest_mail = _ctx->dest_mail;
 	}
-	return mf;
 }
 
 static bool
@@ -384,7 +382,6 @@
 int maildir_save_begin(struct mail_save_context *_ctx, struct istream *input)
 {
 	struct maildir_save_context *ctx = (struct maildir_save_context *)_ctx;
-	struct maildir_filename *mf;
 
 	T_BEGIN {
 		/* create a new file in tmp/ directory */
@@ -398,7 +395,7 @@
 				ctx->input = i_stream_create_crlf(input);
 			else
 				ctx->input = i_stream_create_lf(input);
-			mf = maildir_save_add(_ctx, fname, fname == _ctx->guid);
+			maildir_save_add(_ctx, fname, fname == _ctx->guid);
 		}
 	} T_END;
 
@@ -836,11 +833,10 @@
 {
 	struct maildir_filename *mf;
 	bool newdir, new_changed, cur_changed;
-	int ret = 0;
+	int ret;
 
 	*last_mf_r = NULL;
 
-	ret = 0;
 	new_changed = cur_changed = FALSE;
 	for (mf = ctx->files; mf != NULL; mf = mf->next) {
 		T_BEGIN {
--- a/src/lib-storage/index/maildir/maildir-storage.h	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.h	Mon Apr 05 01:06:02 2010 +0300
@@ -121,9 +121,8 @@
 void maildir_save_add_conflict(struct mailbox_transaction_context *t,
 			       uint32_t old_uid, uint32_t new_uid);
 
-struct maildir_filename *
-maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
-		 bool preserve_filename);
+void maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
+		      bool preserve_filename);
 const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
 				       uint32_t seq);
 
--- a/src/lib-storage/index/maildir/maildir-sync.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/maildir/maildir-sync.c	Mon Apr 05 01:06:02 2010 +0300
@@ -366,7 +366,7 @@
 	unsigned int i = 0, move_count = 0;
 	time_t now;
 	int ret = 1;
-	bool move_new, check_touch, dir_changed = FALSE;
+	bool move_new, dir_changed = FALSE;
 
 	path = new_dir ? ctx->new_dir : ctx->cur_dir;
 	for (i = 0;; i++) {
@@ -427,7 +427,6 @@
 		if (dp->d_name[0] == '.')
 			continue;
 
-		check_touch = FALSE;
 		flags = 0;
 		if (move_new) {
 			str_truncate(src, 0);
@@ -633,15 +632,13 @@
 static void maildir_sync_update_next_uid(struct maildir_mailbox *mbox)
 {
 	const struct mail_index_header *hdr;
-	uint32_t uid_validity, next_uid;
+	uint32_t uid_validity;
 
 	hdr = mail_index_get_header(mbox->box.view);
 	if (hdr->uid_validity == 0)
 		return;
 
 	uid_validity = maildir_uidlist_get_uid_validity(mbox->uidlist);
-	next_uid = maildir_uidlist_get_next_uid(mbox->uidlist);
-
 	if (uid_validity == hdr->uid_validity || uid_validity == 0) {
 		/* make sure uidlist's next_uid is at least as large as
 		   index file's. typically this happens only if uidlist gets
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c	Mon Apr 05 01:06:02 2010 +0300
@@ -184,7 +184,6 @@
 	stream->skip = 0;
 	stream->buffer = NULL;
 
-	ret = 0;
 	do {
 		buf = i_stream_get_data(stream->parent, &pos);
 		if (pos > 1 && stream->istream.v_offset + pos >
--- a/src/lib-storage/index/mbox/mbox-lock.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/mbox/mbox-lock.c	Mon Apr 05 01:06:02 2010 +0300
@@ -457,7 +457,7 @@
 static int mbox_lock_flock(struct mbox_lock_context *ctx, int lock_type,
 			   time_t max_wait_time)
 {
-	time_t now, last_notify;
+	time_t now;
 	unsigned int next_alarm;
 
 	if (mbox_file_open_latest(ctx, lock_type) < 0)
@@ -485,7 +485,6 @@
 			alarm(I_MIN(max_wait_time - now, 5));
 	}
 
-        last_notify = 0;
 	while (flock(ctx->mbox->mbox_fd, lock_type) < 0) {
 		if (errno != EINTR) {
 			if (errno == EWOULDBLOCK && max_wait_time == 0) {
@@ -524,7 +523,7 @@
 static int mbox_lock_lockf(struct mbox_lock_context *ctx, int lock_type,
 			   time_t max_wait_time)
 {
-	time_t now, last_notify;
+	time_t now;
 	unsigned int next_alarm;
 
 	if (mbox_file_open_latest(ctx, lock_type) < 0)
@@ -548,7 +547,6 @@
 		lock_type = F_LOCK;
 	}
 
-        last_notify = 0;
 	while (lockf(ctx->mbox->mbox_fd, lock_type, 0) < 0) {
 		if (errno != EINTR) {
 			if ((errno == EACCES || errno == EAGAIN) &&
--- a/src/lib-storage/index/mbox/mbox-save.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c	Mon Apr 05 01:06:02 2010 +0300
@@ -200,7 +200,6 @@
 		if ((flags & flags_list[i].flag) != 0)
 			str_append_c(str, flags_list[i].chr);
 	}
-	flags ^= MBOX_NONRECENT_KLUDGE;
 }
 
 static void mbox_save_append_flag_headers(string_t *str, enum mail_flags flags)
--- a/src/lib-storage/index/mbox/mbox-sync-update.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync-update.c	Mon Apr 05 01:06:02 2010 +0300
@@ -112,7 +112,7 @@
 
 	/* @UNSAFE */
 	data = buffer_get_space_unsafe(ctx->header, pos, need);
-	for (i = 0, need = 0; flags_list[i].chr != 0; i++) {
+	for (i = 0; flags_list[i].chr != 0; i++) {
 		if ((ctx->mail.flags & flags_list[i].flag) != 0)
 			*data++ = flags_list[i].chr;
 	}
@@ -187,11 +187,9 @@
 
 static void mbox_sync_add_missing_headers(struct mbox_sync_mail_context *ctx)
 {
-	size_t old_hdr_size, new_hdr_size, startpos;
+	size_t new_hdr_size, startpos;
 
-	old_hdr_size = ctx->body_offset - ctx->hdr_offset;
 	new_hdr_size = str_len(ctx->header);
-
 	if (new_hdr_size > 0 &&
 	    str_data(ctx->header)[new_hdr_size-1] != '\n') {
 		/* broken header - doesn't end with \n. fix it. */
--- a/src/lib-storage/list/mailbox-list-fs.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/list/mailbox-list-fs.c	Mon Apr 05 01:06:02 2010 +0300
@@ -501,7 +501,7 @@
 				  const char *newname, bool rename_children)
 {
 	struct mail_storage *oldstorage;
-	const char *oldpath, *newpath, *alt_oldpath, *alt_newpath, *root_path;
+	const char *oldpath, *newpath, *alt_newpath, *root_path;
 	const char *p, *origin;
 	enum mailbox_list_path_type path_type, alt_path_type;
 	struct stat st;
@@ -528,7 +528,6 @@
 
 	oldpath = mailbox_list_get_path(oldlist, oldname, path_type);
 	newpath = mailbox_list_get_path(newlist, newname, path_type);
-	alt_oldpath = mailbox_list_get_path(oldlist, oldname, alt_path_type);
 	alt_newpath = mailbox_list_get_path(newlist, newname, alt_path_type);
 
 	root_path = mailbox_list_get_path(oldlist, NULL,
--- a/src/lib-storage/mail-storage-service.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib-storage/mail-storage-service.c	Mon Apr 05 01:06:02 2010 +0300
@@ -116,7 +116,7 @@
 		  const char **error_r)
 {
 	struct setting_parser_context *set_parser = user->set_parser;
-	const char *const *str, *p, *line, *key;
+	const char *const *str, *line, *key;
 	unsigned int i, count;
 	bool mail_debug;
 	int ret = 0;
@@ -163,7 +163,7 @@
 			}
 #endif
 		} else T_BEGIN {
-			if ((p = strchr(str[i], '=')) == NULL)
+			if (strchr(str[i], '=') == NULL)
 				line = t_strconcat(str[i], "=yes", NULL);
 			else
 				line = str[i];
@@ -464,9 +464,6 @@
 mail_storage_service_init_log(struct master_service *service,
 			      struct mail_storage_service_user *user)
 {
-	const struct mail_user_settings *user_set;
-
-	user_set = master_service_settings_get_others(service)[0];
 	T_BEGIN {
 		string_t *str;
 
--- a/src/lib/askpass.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/askpass.c	Mon Apr 05 01:06:02 2010 +0300
@@ -12,7 +12,6 @@
 {
         struct termios old_tio, tio;
 	bool restore_tio = FALSE;
-	ssize_t ret;
 	size_t pos;
 	char ch;
 	int fd;
@@ -37,7 +36,7 @@
 
 	/* read the password */
 	pos = 0;
-	while ((ret = read(fd, &ch, 1)) > 0) {
+	while (read(fd, &ch, 1) > 0) {
 		if (pos >= buf_size-1)
 			break;
 		if (ch == '\n' || ch == '\r')
--- a/src/lib/file-cache.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/file-cache.c	Mon Apr 05 01:06:02 2010 +0300
@@ -310,7 +310,6 @@
 
 	/* set the last byte */
 	if (size > 0) {
-		mask = 0;
 		for (i = 0, mask = 0; i < size; i++)
 			mask |= 1 << i;
 		*bits &= ~mask;
--- a/src/lib/file-dotlock.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/file-dotlock.c	Mon Apr 05 01:06:02 2010 +0300
@@ -507,7 +507,6 @@
 				lock_info.wait_usecs += lock_info.wait_usecs/2;
 			}
 			dotlock_wait(&lock_info);
-			do_wait = FALSE;
 		}
 
 		ret = check_lock(now, &lock_info);
@@ -526,7 +525,6 @@
 				break;
 		}
 
-		do_wait = TRUE;
 		if (last_notify != now && set->callback != NULL) {
 			last_notify = now;
 			change_secs = now - lock_info.last_change;
@@ -548,6 +546,7 @@
 			}
 		}
 
+		do_wait = TRUE;
 		now = time(NULL);
 	} while (now < max_wait_time);
 
--- a/src/lib/home-expand.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/home-expand.c	Mon Apr 05 01:06:02 2010 +0300
@@ -9,13 +9,13 @@
 int home_try_expand(const char **_path)
 {
 	const char *path = *_path;
-	const char *home, *p, *orig_path;
+	const char *home, *p;
 	struct passwd *pw;
 
 	if (path == NULL || *path != '~')
 		return 0;
 
-	orig_path = path++;
+	path++;
 	if (*path == '/' || *path == '\0') {
 		home = getenv("HOME");
 		if (*path != '\0') path++;
--- a/src/lib/istream-tee.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/istream-tee.c	Mon Apr 05 01:06:02 2010 +0300
@@ -138,7 +138,7 @@
 		tee_streams_skip(tstream->tee);
 		ret = i_stream_read(input);
 		if (ret <= 0) {
-			data = i_stream_get_data(input, &size);
+			(void)i_stream_get_data(input, &size);
 			if (ret == -2 && stream->skip != 0) {
 				/* someone else is holding the data,
 				   wait for it */
--- a/src/lib/seq-range-array.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/seq-range-array.c	Mon Apr 05 01:06:02 2010 +0300
@@ -188,7 +188,7 @@
 
 	/* somewhere in the middle, array is sorted so find it with
 	   binary search */
-	idx = 0; left_idx = 0; right_idx = count;
+	left_idx = 0; right_idx = count;
 	while (left_idx < right_idx) {
 		idx = (left_idx + right_idx) / 2;
 
--- a/src/lib/strescape.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/strescape.c	Mon Apr 05 01:06:02 2010 +0300
@@ -36,7 +36,6 @@
 	size_t start = 0, i = 0;
 
 	while (i < src_size) {
-		start = i;
 		for (; i < src_size; i++) {
 			if (src_c[i] == '\\')
 				break;
@@ -127,7 +126,6 @@
 	size_t start = 0, i = 0;
 
 	while (i < src_size) {
-		start = i;
 		for (; i < src_size; i++) {
 			if (src_c[i] == '\001')
 				break;
--- a/src/lib/strfuncs.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/lib/strfuncs.c	Mon Apr 05 01:06:02 2010 +0300
@@ -306,7 +306,7 @@
 		dstsize--;
 	}
 
-	*dest++ = '\0';
+	*dest = '\0';
 	return *src == '\0' ? 0 : -1;
 }
 
--- a/src/login-common/client-common-auth.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/login-common/client-common-auth.c	Mon Apr 05 01:06:02 2010 +0300
@@ -342,9 +342,7 @@
 
 static void client_auth_input(struct client *client)
 {
-	int ret;
-
-	if ((ret = client->v.auth_parse_response(client)) <= 0)
+	if (client->v.auth_parse_response(client) <= 0)
 		return;
 
 	client_set_auth_waiting(client);
--- a/src/login-common/ssl-proxy-openssl.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/login-common/ssl-proxy-openssl.c	Mon Apr 05 01:06:02 2010 +0300
@@ -362,12 +362,12 @@
 
 static const char *ssl_last_error(void)
 {
-	unsigned long err, err2;
+	unsigned long err;
 	const char *data;
 	int flags;
 
 	err = ERR_get_error_line_data(NULL, NULL, &data, &flags);
-	while (err != 0 && (err2 = ERR_peek_error()) != 0) {
+	while (err != 0 && ERR_peek_error() != 0) {
 		i_error("SSL: Stacked error: %s",
 			ssl_err2str(err, data, flags));
 		err = ERR_get_error();
--- a/src/master/main.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/master/main.c	Mon Apr 05 01:06:02 2010 +0300
@@ -768,7 +768,7 @@
 	}
 	i_assert(child_process_env_idx <
 		 sizeof(child_process_env) / sizeof(child_process_env[0]));
-	child_process_env[child_process_env_idx++] = NULL;
+	child_process_env[child_process_env_idx] = NULL;
 
 	/* create service structures from settings. if there are any errors in
 	   service configuration we'll catch it here. */
--- a/src/plugins/fts-squat/squat-trie.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/plugins/fts-squat/squat-trie.c	Mon Apr 05 01:06:02 2010 +0300
@@ -389,7 +389,6 @@
 		/* first child */
 		node->children.data = i_malloc(new_size);
 		trie->node_alloc_size += new_size;
-		children = NODE_CHILDREN_NODES(node);
 	} else {
 		old_size = NODE_CHILDREN_ALLOC_SIZE(old_child_count);
 		if (old_size != new_size) {
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Apr 05 01:06:02 2010 +0300
@@ -74,7 +74,6 @@
 		       const char **error_r)
 {
 	struct mailbox *box;
-	struct mail_storage *storage;
 	enum mail_error error;
 
 	box = mailbox_alloc(list, name, MAILBOX_FLAG_KEEP_RECENT |
@@ -92,7 +91,6 @@
 	}
 
 	/* try creating and re-opening it. */
-	storage = mail_namespace_get_default_storage(list->ns);
 	if (mailbox_create(box, NULL, FALSE) < 0 ||
 	    mailbox_open(box) < 0) {
 		*error_r = mail_storage_get_last_error(mailbox_get_storage(box),
--- a/src/pop3/pop3-client.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/pop3/pop3-client.c	Mon Apr 05 01:06:02 2010 +0300
@@ -535,9 +535,7 @@
 
 static int client_output(struct client *client)
 {
-	int ret;
-
-	if ((ret = o_stream_flush(client->output)) < 0) {
+	if (o_stream_flush(client->output) < 0) {
 		client_destroy(client, NULL);
 		return 1;
 	}
--- a/src/util/maildirlock.c	Mon Apr 05 01:04:19 2010 +0300
+++ b/src/util/maildirlock.c	Mon Apr 05 01:06:02 2010 +0300
@@ -39,7 +39,7 @@
 {
 	struct dotlock *dotlock;
 	unsigned int timeout;
-	pid_t pid, parent_pid;
+	pid_t pid;
 	int fd[2], ret;
 	char c;
 
@@ -48,7 +48,6 @@
 			" - SIGTERM will release the lock.\n");
 		return 1;
 	}
-	parent_pid = getpid();
 	if (pipe(fd) != 0) {
 		fprintf(stderr, "pipe() failed: %s", strerror(errno));
 		return 1;