]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Removed dead code.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:06:02 +0000 (01:06 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Apr 2010 22:06:02 +0000 (01:06 +0300)
--HG--
branch : HEAD

51 files changed:
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

index 84f78874312cd3c9aa05513d3e00c1290f6d37b0..b70dd871c4b3419db1fff146edb56ddb5d028357 100644 (file)
@@ -464,9 +464,7 @@ static void master_input(struct auth_master_connection *conn)
 
 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;
index 2b815cf4f1544e2c2b1d009e78c4d1913e828495..9f0a580ab6bca8f3b1a4a1bacab5720c308c991e 100644 (file)
@@ -103,7 +103,7 @@ static void get_client_extra_fields(struct auth_request *request,
                                    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 @@ static void get_client_extra_fields(struct auth_request *request,
        }
 
        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;
index 224703b6a8f1e1842cb30bc7b5f9abaeca6f20d1..5b355a9e7c68c21a947a6791f615a9ed6c579659 100644 (file)
@@ -202,9 +202,9 @@ config_apply_auth_set(struct config_parser_context *ctx,
 
 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, ", ");
index 202fa7015e2096fcad5ff25eeeffe69b6e9cae07..f2ad2f16e38b9c51fd6b4acd08c7acc71f57cd70 100644 (file)
@@ -48,7 +48,6 @@ static int cmd_iterate_flush(struct dict_connection *conn)
 {
        string_t *str;
        const char *key, *value;
-       int ret;
 
        str = t_str_new(256);
        o_stream_cork(conn->output);
@@ -73,7 +72,7 @@ static int cmd_iterate_flush(struct dict_connection *conn)
        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));
index 6f02a90abf731925d55ef2728c6c538bc407cd15..9b7e6567597801bc4a2c7380f781da25de84e123 100644 (file)
@@ -397,7 +397,7 @@ static void log_record_print(const struct mail_transaction_header *hdr,
                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 @@ static void log_record_print(const struct mail_transaction_header *hdr,
                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++) {
index 461145703f6a33eeae69612a0cbaae219f27a038..b32f682457b0ca918c90431c197eb2c891103ddd 100644 (file)
@@ -9,7 +9,6 @@ bool cmd_close(struct client_command_context *cmd)
        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 @@ bool cmd_close(struct client_command_context *cmd)
        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);
index df4bcbf5180092332cc11236b4f7f7f824c903d4..39ef8c023ce36fe3cd23f473161e1da85399b003 100644 (file)
@@ -358,12 +358,11 @@ list_namespace_mailboxes(struct cmd_list_context *ctx)
        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;
index 039cd69470608ffa8c2ecaef53347593650198b8..ae630d6502863894e310ff2742108f96697b330c 100644 (file)
@@ -30,13 +30,12 @@ static int select_qresync_get_uids(struct imap_select_context *ctx,
                                   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 void cmd_select_finish(struct imap_select_context *ctx, int ret)
 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;
        }
index cb6f89cadd282ed852993bd284d7f663569c2014..af77dcdbb900176560b59941bbf06440ae3d0cc0 100644 (file)
@@ -78,7 +78,7 @@ get_sort_program(struct client_command_context *cmd,
                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,
index 5110a104183fd8c89c21193625d38607be72dcb8..73523b5bd9e9a7d29bb96268edb00589ab7e64f6 100644 (file)
@@ -7,7 +7,6 @@ bool cmd_unselect(struct client_command_context *cmd)
 {
        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 @@ bool cmd_unselect(struct client_command_context *cmd)
        i_assert(client->mailbox_change_lock == NULL);
        client->mailbox = NULL;
 
-       storage = mailbox_get_storage(mailbox);
        mailbox_free(&mailbox);
        client_update_mailbox_flags(client, NULL);
 
index 8a0743799a21f77e80178fe64f39c1fde8135c14..28378439eecbbaa2b01e25af90f80ecb87e3a5d9 100644 (file)
@@ -167,7 +167,7 @@ create_raw_stream(struct mail_deliver_context *ctx,
        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;
index 6b598fb9cdd945fe0d258581bbb46978981c113e..95b7d541eff70ee6454538c1391baa94b00a3e7d 100644 (file)
@@ -69,7 +69,7 @@ static const char *pattern_compress(const char *pattern)
                        *dest++ = *pattern++;
                }
        }
-       *dest++ = '\0';
+       *dest = '\0';
        return ret;
 }
 
index 57b5e00ef3ee4bca749ed34ed576c8d5cc61acb0..4ede709ab187c83628b3f627e792580949a0de4e 100644 (file)
@@ -884,7 +884,7 @@ static int mail_cache_header_add_field(struct mail_cache_transaction_ctx *ctx,
        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 @@ static int mail_cache_header_add_field(struct mail_cache_transaction_ctx *ctx,
                        return 0;
 
                /* need to add it */
-               if ((ret = mail_cache_transaction_lock(ctx)) <= 0)
+               if (mail_cache_transaction_lock(ctx) <= 0)
                        return -1;
        }
 
index d17bf9965f2c649dd0bcaf501b305fe56194c8dd..0c8294c34945784e7dcb12cf9c8214a24c4b33c1 100644 (file)
@@ -338,7 +338,7 @@ sync_ext_resize(const struct mail_transaction_ext_intro *u,
                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 @@ mail_index_sync_ext_init_new(struct mail_index_sync_map_ctx *ctx,
                             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 @@ static void mail_index_sync_ext_clear(struct mail_index_view *view,
 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;
 
index 8efaef7da9ef86ee40314ff9a530ee7d3d29f609..c861df6b93702242078ff406981192f54be83d6a 100644 (file)
@@ -237,7 +237,7 @@ sync_expunge_call_handlers(struct mail_index_sync_map_ctx *ctx,
 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 @@ int mail_index_sync_record(struct mail_index_sync_map_ctx *ctx,
                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 @@ int mail_index_sync_record(struct mail_index_sync_map_ctx *ctx,
                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 @@ int mail_index_sync_record(struct mail_index_sync_map_ctx *ctx,
                        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 @@ int mail_index_sync_record(struct mail_index_sync_map_ctx *ctx,
                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++)
index 8b98767b0d0751782e5335ef52e0e0dda762d61c..40620f03cb9678652a885d95349248154733c428 100644 (file)
@@ -511,7 +511,7 @@ mail_index_view_sync_begin(struct mail_index_view *view,
                           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 @@ mail_index_view_sync_begin(struct mail_index_view *view,
                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) {
index 3fdae71ca23660c8d38fc318766df1ded37d1fb0..ddfa08b6b9c781f3f87af5cac8e5152fb8e33e2b 100644 (file)
@@ -278,7 +278,7 @@ mail_index_data_lookup_keywords(struct mail_index_map *map,
                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;
index 32db86889d5ee64fe8481adca4eea319631abd02..2fb34b638bde19c6695e320d21f11e3893f14709 100644 (file)
@@ -845,7 +845,7 @@ void mail_transaction_update_modseq(const struct mail_transaction_header *hdr,
                *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++) {
index b94e7cdcd79f606dd2c0118038dd8fc3fb7abe69..2002f280ed8e721f3fce1ba3f2d23825b8ca6fe2 100644 (file)
@@ -181,7 +181,6 @@ int mail_send_forward(struct mail_deliver_context *ctx, const char *forwardto)
     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 @@ int mail_send_forward(struct mail_deliver_context *ctx, const char *forwardto)
                                           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);
index 243bd7b65246169b035acabff20a0adcd837a579..596e013da7fea933883ef705ac5c9c01a007d1b7 100644 (file)
@@ -77,7 +77,7 @@ void message_header_decode(const unsigned char *data, size_t size,
        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++;
index d75db9606393f3949bcc1cb167bff7c33cfcc92e..a5eea65430726bda45d2b5a005333c3f56bac431 100644 (file)
@@ -57,7 +57,7 @@ int message_parse_header_next(struct message_header_parser_ctx *ctx,
 {
         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 @@ int message_parse_header_next(struct message_header_parser_ctx *ctx,
                                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])) {
index 1e3ed031911f3328d43ac3483a07cd20f2c785ed..17f263243077571ca61764e2a3445e93c6c98d0d 100644 (file)
@@ -25,7 +25,6 @@ static void test_istream_filter(void)
        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 @@ static void test_istream_filter(void)
 
        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);
 
index 01fac8adf4fceb38f5e3593109151460bb47e71b..c91899511db2902fbf80ce5473edf20a7158128f 100644 (file)
@@ -59,8 +59,7 @@ struct mail_save_context *
 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);
 
index 81abe5e303723314b8b62a7c91488dda56e3e7ee..fc011ff0532c7aef45f8ad87b1016f5557573a7d 100644 (file)
@@ -36,7 +36,6 @@ dbox_file_find_next_magic(struct dbox_file *file, uoff_t *offset_r, bool *pre_r)
        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 @@ dbox_file_fix_write_stream(struct dbox_file *file, uoff_t start_offset,
 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);
index f91d616373ccc6ad719b528a31d0efa224cfd133..769f60c6e5f28379eebac89b9ef614f9d5e93896 100644 (file)
@@ -232,7 +232,7 @@ static void mdbox_file_close_later(struct mdbox_file *mfile)
 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 @@ void mdbox_file_unrefed(struct dbox_file *file)
        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);
index 396d0f261dae8b797cec93965a42a2851c5b2d03..738fc45c238d8d7edfda241c7fb080b95d2ad450 100644 (file)
@@ -1369,10 +1369,9 @@ void index_mail_cache_parse_continue(struct mail *_mail)
 {
        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;
 
index b541edf5e46ad7d7fa8895e8e96f2c1259e7903e..5a8e007909c66f38a1ddde33bd22709ff511e4ab 100644 (file)
@@ -208,7 +208,6 @@ static void mail_thread_strmap_remap(const uint32_t *idx_map,
           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];
index 9fed0014f355fe68c66d7e65a5bee43b25ff512e..69074859d9d3c89ca7603dbe3d68019e28ff8941 100644 (file)
@@ -140,9 +140,8 @@ maildir_save_transaction_init(struct mailbox_transaction_context *t)
        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 @@ maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
                ctx->input = input;
                ctx->cur_dest_mail = _ctx->dest_mail;
        }
-       return mf;
 }
 
 static bool
@@ -384,7 +382,6 @@ maildir_save_alloc(struct mailbox_transaction_context *t)
 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 @@ int maildir_save_begin(struct mail_save_context *_ctx, struct istream *input)
                                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 @@ maildir_save_move_files_to_newcur(struct maildir_save_context *ctx,
 {
        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 {
index 022ac64fdcbf8476ea7f1f630d3ab103f0e1c7c8..4004601fca80de226433cf815c512f9803ab619e 100644 (file)
@@ -121,9 +121,8 @@ void maildir_save_cancel(struct mail_save_context *ctx);
 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);
 
index feba5fb66e942776d7e3b870cd919448150d9364..64f245a2cb361989fd5609103bb36515d58fced4 100644 (file)
@@ -366,7 +366,7 @@ maildir_scan_dir(struct maildir_sync_context *ctx, bool new_dir, bool final)
        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 @@ maildir_scan_dir(struct maildir_sync_context *ctx, bool new_dir, bool final)
                if (dp->d_name[0] == '.')
                        continue;
 
-               check_touch = FALSE;
                flags = 0;
                if (move_new) {
                        str_truncate(src, 0);
@@ -633,15 +632,13 @@ static int maildir_sync_quick_check(struct maildir_mailbox *mbox, bool undirty,
 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
index 603ab15faffc7f88db2bc9c26b817f33ba369e8c..177c5f0c2b2f82c49623adc46c25758bf1ee6cd9 100644 (file)
@@ -184,7 +184,6 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream)
        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 >
index 3adf0bffca093a997f2cc07d7f02bd545ca2a0af..2a677b97a4ca713c508ec17be517959842d60764 100644 (file)
@@ -457,7 +457,7 @@ static int mbox_lock_dotlock_try(struct mbox_lock_context *ctx, int lock_type,
 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 @@ static int mbox_lock_flock(struct mbox_lock_context *ctx, int lock_type,
                        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_flock(struct mbox_lock_context *ctx, int lock_type,
 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 @@ static int mbox_lock_lockf(struct mbox_lock_context *ctx, int lock_type,
                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) &&
index ce789ef9287c131a9c0b4cb6de195fc1ebf6250a..8c653302e8e203150d3eab9db9238a5601d6e44c 100644 (file)
@@ -200,7 +200,6 @@ static void status_flags_append(string_t *str, enum mail_flags flags,
                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)
index d5d8faae5697a3fa824d9729a67b85bb031f9fc0..07b7292afce76aa403d3a4ea95e9e35087029888 100644 (file)
@@ -112,7 +112,7 @@ static void status_flags_replace(struct mbox_sync_mail_context *ctx, size_t pos,
 
        /* @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 @@ keywords_append_all(struct mbox_sync_mail_context *ctx, string_t *dest,
 
 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. */
index f09c90d5f3f27b93f866009cf2bc7b8dc3ec68a0..1238ff9898980bd13baa8b648c4688a481e72bf0 100644 (file)
@@ -501,7 +501,7 @@ static int fs_list_rename_mailbox(struct mailbox_list *oldlist,
                                  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 @@ static int fs_list_rename_mailbox(struct mailbox_list *oldlist,
 
        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,
index 8fda54dabb38ed5b9e091f70a2e9372c54dc9e90..f9950ba13d58f8e09e83f263f66e5aaeec612207 100644 (file)
@@ -116,7 +116,7 @@ user_reply_handle(struct mail_storage_service_user *user,
                  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 @@ user_reply_handle(struct mail_storage_service_user *user,
                        }
 #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 @@ static void
 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;
 
index b79468fc332720fe79d42d30423c5ddf1d4dc5c5..de98b138970605ae96b9c4187c0ffb2f91699ce3 100644 (file)
@@ -12,7 +12,6 @@ void askpass(const char *prompt, char *buf, size_t buf_size)
 {
         struct termios old_tio, tio;
        bool restore_tio = FALSE;
-       ssize_t ret;
        size_t pos;
        char ch;
        int fd;
@@ -37,7 +36,7 @@ void askpass(const char *prompt, char *buf, size_t buf_size)
 
        /* 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')
index ccf48fdc5b49b831cd34989b58a831a65776ce29..d77611ffca271158e419d8f84ef1f1e228c9af03 100644 (file)
@@ -310,7 +310,6 @@ void file_cache_invalidate(struct file_cache *cache, uoff_t offset, uoff_t size)
 
        /* set the last byte */
        if (size > 0) {
-               mask = 0;
                for (i = 0, mask = 0; i < size; i++)
                        mask |= 1 << i;
                *bits &= ~mask;
index 882500e12965937b18349bc4eda37da27bea85fc..f5627c12d29dbbf7f87a32c6768c5433ba19107d 100644 (file)
@@ -507,7 +507,6 @@ dotlock_create(struct dotlock *dotlock, enum dotlock_create_flags flags,
                                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 @@ dotlock_create(struct dotlock *dotlock, enum dotlock_create_flags flags,
                                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 @@ dotlock_create(struct dotlock *dotlock, enum dotlock_create_flags flags,
                        }
                }
 
+               do_wait = TRUE;
                now = time(NULL);
        } while (now < max_wait_time);
 
index c62c8b98c7502ede015eee7edd771c3938ed5288..ae9ec404fb091a2ba1dc4c0ce64148a08e404907 100644 (file)
@@ -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++;
index 490fb8606019a2b0e748a7875410c58b06bd7060..a126231594381fe43030edd9ea2c7b6f82cd92b5 100644 (file)
@@ -138,7 +138,7 @@ static ssize_t i_stream_tee_read(struct istream_private *stream)
                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 */
index 759c81b81969bec81c286bba718c89585a81b0f5..4ef9f0410ffbaf21c747a6caa7d24eebcf104158 100644 (file)
@@ -188,7 +188,7 @@ bool seq_range_array_remove(ARRAY_TYPE(seq_range) *array, uint32_t seq)
 
        /* 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;
 
index 675d8a2c4306bfd2c8d12085f3eb81396360ac47..da4feab45a5cef6f10ad3f3364ec1b5a082b3c4a 100644 (file)
@@ -36,7 +36,6 @@ void str_append_unescaped(string_t *dest, const void *src, size_t src_size)
        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 @@ void str_append_tabunescaped(string_t *dest, const void *src, size_t src_size)
        size_t start = 0, i = 0;
 
        while (i < src_size) {
-               start = i;
                for (; i < src_size; i++) {
                        if (src_c[i] == '\001')
                                break;
index d77b4f11bb9f79c9671c80e5b00342463101554c..86f0ad24997a1dd5c2b7f852b3f4bd88314c13a3 100644 (file)
@@ -306,7 +306,7 @@ int i_strocpy(char *dest, const char *src, size_t dstsize)
                dstsize--;
        }
 
-       *dest++ = '\0';
+       *dest = '\0';
        return *src == '\0' ? 0 : -1;
 }
 
index 61ce699e9fb3aba6be461d3a5fa66b327428727a..8c9d588037cf624bd281a9130e52103903036ca1 100644 (file)
@@ -342,9 +342,7 @@ int client_auth_parse_response(struct client *client)
 
 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);
index 4f94e3d9b73c643c8145e35b852fb2791bea1bad..c9a531a66de2116fa95f45758f2908c2d4f9c266 100644 (file)
@@ -362,12 +362,12 @@ static const char *ssl_err2str(unsigned long err, const char *data, int flags)
 
 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();
index 00ff7af897264455f134ae7d94a85703f18092b2..926e452f00174f9fc60813f9ab301346d8c788e6 100644 (file)
@@ -768,7 +768,7 @@ int main(int argc, char *argv[])
        }
        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. */
index a8c53af722f8ffb6d4b08b26cd916c702c51d7ee..268d8402bf068fb667b5f5baba05fe6e62f80f01 100644 (file)
@@ -389,7 +389,6 @@ node_add_child(struct squat_trie *trie, struct squat_node *node,
                /* 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) {
index 5e82a26bb32c7ee277f36933b4224590bf1b8258..4cee6cb6139e39807e222e2ad20f54a522f5770e 100644 (file)
@@ -74,7 +74,6 @@ mailbox_open_or_create(struct mailbox_list *list, const char *name,
                       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 @@ mailbox_open_or_create(struct mailbox_list *list, const char *name,
        }
 
        /* 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),
index a1a0f79e422b93b2efe69a87e5d6c38bc28f9e28..580cd6558fa1513c3b6eff9be049906030ec5b69 100644 (file)
@@ -535,9 +535,7 @@ static void client_input(struct client *client)
 
 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;
        }
index 193c6d99068caea29a5fa907b3070f59b3e6b077..31581c7e87d93f9fab04f9a9518c4a43549c760b 100644 (file)
@@ -39,7 +39,7 @@ int main(int argc, const char *argv[])
 {
        struct dotlock *dotlock;
        unsigned int timeout;
-       pid_t pid, parent_pid;
+       pid_t pid;
        int fd[2], ret;
        char c;
 
@@ -48,7 +48,6 @@ int main(int argc, const char *argv[])
                        " - SIGTERM will release the lock.\n");
                return 1;
        }
-       parent_pid = getpid();
        if (pipe(fd) != 0) {
                fprintf(stderr, "pipe() failed: %s", strerror(errno));
                return 1;