From: Timo Sirainen Date: Tue, 24 Mar 2020 10:21:26 +0000 (+0200) Subject: global: Remove dead assignments X-Git-Tag: 2.3.11.2~510 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fa366b8db9a69c0f0e525081e8e6cf974935316;p=thirdparty%2Fdovecot%2Fcore.git global: Remove dead assignments Found by latest clang scan-build. --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 84754e7506..7b2d320160 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -1670,10 +1670,9 @@ db_ldap_field_ptr_expand(const char *data, void *context, { struct db_ldap_result_iterate_context *ctx = context; const char *field_name, *suffix; - int ret; suffix = strchr(t_strcut(data, ':'), '@'); - if ((ret = db_ldap_field_expand(data, ctx, &field_name, error_r)) <= 0) + if (db_ldap_field_expand(data, ctx, &field_name, error_r) <= 0) i_unreached(); if (field_name[0] == '\0') { *value_r = ""; diff --git a/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c b/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c index ec58d23a28..b81ca9c5ff 100644 --- a/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c +++ b/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c @@ -171,7 +171,6 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1, struct dsync_mailbox_tree *orig_tree1, *orig_tree2; struct dsync_mailbox_tree_sync_ctx *ctx; struct dsync_mailbox_node *dup_node1, *dup_node2; - const struct dsync_mailbox_tree_sync_change *change; orig_tree1 = dsync_mailbox_tree_dup(tree1); orig_tree2 = dsync_mailbox_tree_dup(tree2); @@ -182,7 +181,7 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1, ctx = dsync_mailbox_trees_sync_init(tree1, tree2, DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY, DSYNC_MAILBOX_TREES_SYNC_FLAG_DEBUG); - while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) { + while (dsync_mailbox_trees_sync_next(ctx) != NULL) { } dsync_mailbox_trees_sync_deinit(&ctx); test_tree_fixup(tree1); @@ -197,7 +196,7 @@ static void test_trees_nofree(struct dsync_mailbox_tree *tree1, dsync_mailbox_tree_build_guid_hash(orig_tree2, &dup_node1, &dup_node2); ctx = dsync_mailbox_trees_sync_init(orig_tree2, orig_tree1, DSYNC_MAILBOX_TREES_SYNC_TYPE_TWOWAY, 0); - while ((change = dsync_mailbox_trees_sync_next(ctx)) != NULL) { + while (dsync_mailbox_trees_sync_next(ctx) != NULL) { } dsync_mailbox_trees_sync_deinit(&ctx); test_tree_fixup(orig_tree1); diff --git a/src/imap/cmd-subscribe.c b/src/imap/cmd-subscribe.c index 761b47875c..ca7397beea 100644 --- a/src/imap/cmd-subscribe.c +++ b/src/imap/cmd-subscribe.c @@ -9,9 +9,8 @@ static bool subscribe_is_valid_name(struct client_command_context *cmd, struct mailbox *box) { enum mailbox_existence existence; - int ret; - if ((ret = mailbox_exists(box, TRUE, &existence)) < 0) { + if (mailbox_exists(box, TRUE, &existence) < 0) { client_send_box_error(cmd, box); return FALSE; } diff --git a/src/imap/imap-client-hibernate.c b/src/imap/imap-client-hibernate.c index 210e1b6b47..40a05e2c46 100644 --- a/src/imap/imap-client-hibernate.c +++ b/src/imap/imap-client-hibernate.c @@ -117,7 +117,7 @@ imap_hibernate_process_send_cmd(int fd_socket, const char *path, return -1; } i_assert(ret == 1); - if ((ret = write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1)) < 0) { + if (write_full(fd_socket, str_data(cmd)+1, str_len(cmd)-1) < 0) { i_error("write(%s) failed: %m", path); return -1; } diff --git a/src/lib-compression/test-compression.c b/src/lib-compression/test-compression.c index d1d48ad090..dfd9dd8c04 100644 --- a/src/lib-compression/test-compression.c +++ b/src/lib-compression/test-compression.c @@ -736,7 +736,6 @@ static void test_compress_file(const char *in_path, const char *out_path) unsigned char output_sha1[SHA1_RESULTLEN], input_sha1[SHA1_RESULTLEN]; const unsigned char *data; size_t size; - ssize_t ret; handler = compression_lookup_handler_from_ext(out_path); if (handler == NULL) @@ -774,7 +773,7 @@ static void test_compress_file(const char *in_path, const char *out_path) sha1_init(&sha1); file_input = i_stream_create_fd(fd_out, IO_BLOCK_SIZE); input = handler->create_istream(file_input, TRUE); - while ((ret = i_stream_read_more(input, &data, &size)) > 0) { + while (i_stream_read_more(input, &data, &size) > 0) { sha1_loop(&sha1, data, size); i_stream_skip(input, size); } diff --git a/src/lib-dcrypt/dcrypt-openssl.c b/src/lib-dcrypt/dcrypt-openssl.c index 251c7cfe0f..8a0ce1633d 100644 --- a/src/lib-dcrypt/dcrypt-openssl.c +++ b/src/lib-dcrypt/dcrypt-openssl.c @@ -2750,12 +2750,12 @@ dcrypt_openssl_key_string_get_info( *error_r = "Invalid JWK key: Missing kty parameter"; return FALSE; } else if (strcmp(value, "RSA") == 0) { - if ((node = json_tree_find_key(root, "d")) != NULL) + if (json_tree_find_key(root, "d") != NULL) kind = DCRYPT_KEY_KIND_PRIVATE; else kind = DCRYPT_KEY_KIND_PUBLIC; } else if (strcmp(value, "EC") == 0) { - if ((node = json_tree_find_key(root, "d")) != NULL) + if (json_tree_find_key(root, "d") != NULL) kind = DCRYPT_KEY_KIND_PRIVATE; else kind = DCRYPT_KEY_KIND_PUBLIC; diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index ee10f34917..f0f1c66fdc 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -325,7 +325,6 @@ int http_client_connection_check_ready(struct http_client_connection *conn) { const struct http_client_settings *set = http_client_connection_get_settings(conn); - int ret; if (conn->in_req_callback) { /* this can happen when a nested ioloop is created inside request @@ -347,7 +346,7 @@ int http_client_connection_check_ready(struct http_client_connection *conn) /* Active ioloop is different from what we saw earlier; we may have missed a disconnection event on this connection. Verify status by reading from connection. */ - if ((ret=i_stream_read(conn->conn.input)) == -1) { + if (i_stream_read(conn->conn.input) == -1) { int stream_errno = conn->conn.input->stream_errno; i_assert(conn->conn.input->stream_errno != 0 || conn->conn.input->eof); diff --git a/src/lib-http/http-url.c b/src/lib-http/http-url.c index 78af18babf..733e1097c2 100644 --- a/src/lib-http/http-url.c +++ b/src/lib-http/http-url.c @@ -33,13 +33,12 @@ static bool http_url_parse_scheme(struct http_url_parser *url_parser, const char **scheme_r) { struct uri_parser *parser = &url_parser->parser; - int ret; *scheme_r = NULL; if ((url_parser->flags & HTTP_URL_PARSE_SCHEME_EXTERNAL) != 0) return TRUE; - if ((ret = uri_parse_scheme(parser, scheme_r)) <= 0) { + if (uri_parse_scheme(parser, scheme_r) <= 0) { parser->cur = parser->begin; return FALSE; } diff --git a/src/lib-imap-urlauth/imap-urlauth-connection.c b/src/lib-imap-urlauth/imap-urlauth-connection.c index 2813703271..6bf00e806f 100644 --- a/src/lib-imap-urlauth/imap-urlauth-connection.c +++ b/src/lib-imap-urlauth/imap-urlauth-connection.c @@ -848,8 +848,6 @@ static int imap_urlauth_input_next(struct imap_urlauth_connection *conn) static void imap_urlauth_input(struct imap_urlauth_connection *conn) { - int ret; - i_assert(conn->state != IMAP_URLAUTH_STATE_DISCONNECTED); if (conn->input->closed) { @@ -873,7 +871,7 @@ static void imap_urlauth_input(struct imap_urlauth_connection *conn) } while (!conn->input->closed) { - if ((ret = imap_urlauth_input_next(conn)) <= 0) + if (imap_urlauth_input_next(conn) <= 0) break; } } diff --git a/src/lib-imap/imap-url.c b/src/lib-imap/imap-url.c index a456e38e0d..6da6e21752 100644 --- a/src/lib-imap/imap-url.c +++ b/src/lib-imap/imap-url.c @@ -847,8 +847,8 @@ static bool imap_url_do_parse(struct imap_url_parser *url_parser) /* Parse path, i.e. `[ icommand ]` from `*( "/" segment )` */ if (ret > 0 || url_parser->relative) { - if ((ret = imap_url_parse_path(url_parser, path, relative, - &is_messagelist)) < 0) + if (imap_url_parse_path(url_parser, path, relative, + &is_messagelist) < 0) return FALSE; } diff --git a/src/lib-mail/message-part-data.c b/src/lib-mail/message-part-data.c index 94f97fad36..a5771f87e2 100644 --- a/src/lib-mail/message-part-data.c +++ b/src/lib-mail/message-part-data.c @@ -488,8 +488,7 @@ void message_part_data_parse_from_header(pool_t pool, if (part->data == NULL) { /* no Content-* headers. add an empty context structure anyway. */ - part->data = part_data = - p_new(pool, struct message_part_data, 1); + part->data = p_new(pool, struct message_part_data, 1); } else if ((part->flags & MESSAGE_PART_FLAG_IS_MIME) == 0) { /* If there was no Mime-Version, forget all the Content-stuff */ @@ -512,8 +511,7 @@ void message_part_data_parse_from_header(pool_t pool, if (part->data == NULL) { /* initialize message part data */ - part->data = part_data = - p_new(pool, struct message_part_data, 1); + part->data = p_new(pool, struct message_part_data, 1); } part_data = part->data; diff --git a/src/lib-mail/rfc822-parser.c b/src/lib-mail/rfc822-parser.c index bb73b8d76f..f87866f442 100644 --- a/src/lib-mail/rfc822-parser.c +++ b/src/lib-mail/rfc822-parser.c @@ -212,7 +212,7 @@ int rfc822_parse_dot_atom(struct rfc822_parser_context *ctx, string_t *str) ctx->data++; str_append_c(str, '.'); - if ((ret = rfc822_skip_lwsp(ctx)) <= 0) + if (rfc822_skip_lwsp(ctx) <= 0) return -1; start = ctx->data; } diff --git a/src/lib-mail/test-message-parser.c b/src/lib-mail/test-message-parser.c index 373ff01eb0..4f4d684083 100644 --- a/src/lib-mail/test-message-parser.c +++ b/src/lib-mail/test-message-parser.c @@ -75,7 +75,6 @@ static void test_parsed_parts(struct istream *input, struct message_part *parts) struct message_part *parts2; uoff_t i, input_size; const char *error; - int ret; i_stream_seek(input, 0); if (i_stream_get_size(input, TRUE, &input_size) < 0) @@ -87,8 +86,7 @@ static void test_parsed_parts(struct istream *input, struct message_part *parts) test_istream_set_size(input, i/2); if (i > TEST_MSG_LEN*2) test_istream_set_allow_eof(input, TRUE); - while ((ret = message_parser_parse_next_block(parser, - &block)) > 0) ; + while (message_parser_parse_next_block(parser, &block) > 0) ; } test_assert(message_parser_deinit_from_parts(&parser, &parts2, &error) == 0); test_assert(msg_parts_cmp(parts, parts2)); diff --git a/src/lib-smtp/smtp-params.c b/src/lib-smtp/smtp-params.c index c1293a9913..620fe3d3dd 100644 --- a/src/lib-smtp/smtp-params.c +++ b/src/lib-smtp/smtp-params.c @@ -69,7 +69,6 @@ int smtp_param_parse(pool_t pool, const char *text, struct smtp_param *param_r, const char **error_r) { struct smtp_parser parser; - int ret; i_zero(param_r); @@ -81,7 +80,7 @@ int smtp_param_parse(pool_t pool, const char *text, smtp_parser_init(&parser, pool, text); - if ((ret = smtp_param_do_parse(&parser, param_r)) <= 0) { + if (smtp_param_do_parse(&parser, param_r) <= 0) { if (error_r != NULL) *error_r = parser.error; return -1; diff --git a/src/lib-smtp/smtp-parser.c b/src/lib-smtp/smtp-parser.c index 8bddc9944e..a704698b11 100644 --- a/src/lib-smtp/smtp-parser.c +++ b/src/lib-smtp/smtp-parser.c @@ -277,8 +277,7 @@ smtp_parser_parse_ipv4_address(struct smtp_parser *parser, str_append_c(literal, '.'); parser->cur++; - if ((ret = smtp_parser_parse_snum(parser, - literal, &octet)) <= 0) + if (smtp_parser_parse_snum(parser, literal, &octet) <= 0) return -1; ip = (ip << 8) + octet; } @@ -349,7 +348,7 @@ int smtp_parser_parse_address_literal(struct smtp_parser *parser, tagbuf = t_str_new(16); str_append_c(tagbuf, '['); } - if ((ret=smtp_parser_parse_ldh_str(parser, tagbuf)) <= 0 || + if (smtp_parser_parse_ldh_str(parser, tagbuf) <= 0 || parser->cur >= parser->end || *parser->cur != ':') { parser->error = "Invalid address literal"; return -1; @@ -381,8 +380,8 @@ int smtp_parser_parse_address_literal(struct smtp_parser *parser, if (ipv6) { i_zero(&ip6); - if ((ret = inet_pton(AF_INET6, t_strndup(pblock, - parser->cur - pblock), &ip6)) <= 0) { + if (inet_pton(AF_INET6, t_strndup(pblock, + parser->cur - pblock), &ip6) <= 0) { parser->error = "Invalid IPv6 address literal"; return -1; } diff --git a/src/lib-smtp/smtp-server-cmd-data.c b/src/lib-smtp/smtp-server-cmd-data.c index 7d81d927f0..1979a5001e 100644 --- a/src/lib-smtp/smtp-server-cmd-data.c +++ b/src/lib-smtp/smtp-server-cmd-data.c @@ -352,7 +352,6 @@ cmd_data_next(struct smtp_server_cmd_ctx *cmd, struct smtp_server_transaction *trans = conn->state.trans; const struct smtp_server_callbacks *callbacks = conn->callbacks; struct smtp_server_command *command = cmd->cmd; - int ret; /* this command is next to send a reply */ @@ -402,8 +401,8 @@ cmd_data_next(struct smtp_server_cmd_ctx *cmd, smtp_server_command_ref(cmd_temp); i_assert(callbacks != NULL && callbacks->conn_cmd_data_begin != NULL); - if ((ret=callbacks->conn_cmd_data_begin(conn->context, - cmd, conn->state.trans, conn->state.data_input)) < 0) { + if (callbacks->conn_cmd_data_begin(conn->context, + cmd, conn->state.trans, conn->state.data_input) < 0) { i_assert(smtp_server_command_is_replied(cmd_temp)); /* command failed */ smtp_server_command_unref(&cmd_temp); diff --git a/src/lib-smtp/smtp-syntax.c b/src/lib-smtp/smtp-syntax.c index 5d22445f72..fdf5bdee20 100644 --- a/src/lib-smtp/smtp-syntax.c +++ b/src/lib-smtp/smtp-syntax.c @@ -17,7 +17,6 @@ int smtp_string_parse(const char *string, const char **value_r, const char **error_r) { struct smtp_parser parser; - int ret; if (string == NULL || *string == '\0') { *value_r = ""; @@ -26,7 +25,7 @@ int smtp_string_parse(const char *string, smtp_parser_init(&parser, pool_datastack_create(), string); - if ((ret=smtp_parser_parse_string(&parser, value_r)) < 0) { + if (smtp_parser_parse_string(&parser, value_r) < 0) { if (error_r != NULL) *error_r = parser.error; return -1; @@ -85,7 +84,6 @@ int smtp_xtext_parse(const char *xtext, { struct smtp_parser parser; string_t *value = NULL; - int ret; if (xtext == NULL || *xtext == '\0') { *value_r = ""; @@ -96,7 +94,7 @@ int smtp_xtext_parse(const char *xtext, value = t_str_new(256); smtp_parser_init(&parser, pool_datastack_create(), xtext); - if ((ret=smtp_parser_parse_xtext(&parser, value)) < 0) { + if (smtp_parser_parse_xtext(&parser, value) < 0) { if (error_r != NULL) *error_r = parser.error; return -1; @@ -297,7 +295,6 @@ int smtp_ehlo_line_parse(const char *ehlo_line, const char **key_r, const char *const **params_r, const char **error_r) { struct smtp_parser parser; - int ret; if (ehlo_line == NULL || *ehlo_line == '\0') { if (error_r != NULL) @@ -307,7 +304,7 @@ int smtp_ehlo_line_parse(const char *ehlo_line, const char **key_r, smtp_parser_init(&parser, pool_datastack_create(), ehlo_line); - if ((ret=smtp_parse_ehlo_line(&parser, key_r, params_r)) <= 0) { + if (smtp_parse_ehlo_line(&parser, key_r, params_r) <= 0) { if (error_r != NULL) *error_r = parser.error; return -1; diff --git a/src/lib-storage/list/mailbox-list-index-backend.c b/src/lib-storage/list/mailbox-list-index-backend.c index ad3f62a1ce..c662a13af2 100644 --- a/src/lib-storage/list/mailbox-list-index-backend.c +++ b/src/lib-storage/list/mailbox-list-index-backend.c @@ -352,7 +352,7 @@ index_list_mailbox_create(struct mailbox *box, int ret; /* first do a quick check that it doesn't exist */ - if ((ret = index_list_node_exists(list, box->name, &existence)) < 0) { + if (index_list_node_exists(list, box->name, &existence) < 0) { mail_storage_copy_list_error(box->storage, box->list); return -1; } diff --git a/src/lib-storage/list/mailbox-list-index-status.c b/src/lib-storage/list/mailbox-list-index-status.c index 7a0a0a6ed5..45f079bd53 100644 --- a/src/lib-storage/list/mailbox-list-index-status.c +++ b/src/lib-storage/list/mailbox-list-index-status.c @@ -36,9 +36,8 @@ index_list_exists(struct mailbox *box, bool auto_boxes, const struct mail_index_record *rec; enum mailbox_list_index_flags flags; uint32_t seq; - int ret; - if ((ret = mailbox_list_index_view_open(box, FALSE, &view, &seq)) <= 0) { + if (mailbox_list_index_view_open(box, FALSE, &view, &seq) <= 0) { /* failure / not found. fallback to the real storage check just in case to see if the mailbox was just created. */ return ibox->module_ctx.super. @@ -652,12 +651,11 @@ void mailbox_list_index_update_mailbox_index(struct mailbox *box, struct mailbox_status status; guid_128_t mailbox_guid; bool guid_changed = FALSE; - int ret; i_zero(&changes); /* update the mailbox list index even if it has some other pending changes. */ - if ((ret = mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq)) <= 0) + if (mailbox_list_index_view_open(box, FALSE, &list_view, &changes.seq) <= 0) return; guid_128_empty(mailbox_guid); diff --git a/src/lib-storage/list/mailbox-list-subscriptions.c b/src/lib-storage/list/mailbox-list-subscriptions.c index f2cce85404..0123c8cb80 100644 --- a/src/lib-storage/list/mailbox-list-subscriptions.c +++ b/src/lib-storage/list/mailbox-list-subscriptions.c @@ -80,7 +80,8 @@ mailbox_list_subscription_fill_one(struct mailbox_list *list, it should be saved as "pub/", but handle it anyway */ i_assert(strncmp(ns_name, ns->prefix, ns->prefix_len-1) == 0 && ns_name[ns->prefix_len-1] == '\0'); - name = ns_name = ""; + name = ""; + /* ns_name = ""; */ } len = strlen(name); diff --git a/src/lib/uri-util.c b/src/lib/uri-util.c index 67adae8506..85664aedcc 100644 --- a/src/lib/uri-util.c +++ b/src/lib/uri-util.c @@ -383,7 +383,7 @@ uri_parse_ipv4address(struct uri_parser *parser, string_t *literal, str_append_c(literal, '.'); parser->cur++; - if ((ret = uri_parse_dec_octet(parser, literal, &octet)) <= 0) + if (uri_parse_dec_octet(parser, literal, &octet) <= 0) return -1; ip = (ip << 8) + octet; } @@ -589,7 +589,6 @@ uri_parse_ip_literal(struct uri_parser *parser, string_t *literal, const unsigned char *p; const char *address; struct in6_addr ip6; - int ret; /* IP-literal = "[" ( IPv6address / IPvFuture ) "]" * IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) @@ -623,7 +622,7 @@ uri_parse_ip_literal(struct uri_parser *parser, string_t *literal, "Future IP host address '%s' not supported", address); return -1; } - if ((ret = inet_pton(AF_INET6, address, &ip6)) <= 0) { + if (inet_pton(AF_INET6, address, &ip6) <= 0) { parser->error = p_strdup_printf(parser->pool, "Invalid IPv6 host address '%s'", address); return -1; @@ -656,7 +655,7 @@ uri_do_parse_host(struct uri_parser *parser, /* IP-literal / */ if (parser->cur < parser->end && *parser->cur == '[') { - if ((ret=uri_parse_ip_literal(parser, literal, &ip6)) <= 0) + if (uri_parse_ip_literal(parser, literal, &ip6) <= 0) return -1; if (host != NULL) { diff --git a/src/lib/var-expand.c b/src/lib/var-expand.c index 11b930a77e..507fd891f0 100644 --- a/src/lib/var-expand.c +++ b/src/lib/var-expand.c @@ -553,7 +553,7 @@ int var_expand_with_funcs(string_t *dest, const char *str, break; var = NULL; - if (*str == '{' && (end = strchr(str, '}')) != NULL) { + if (*str == '{' && strchr(str, '}') != NULL) { /* %{long_key} */ unsigned int ctr = 1; bool escape = FALSE; diff --git a/src/lmtp/lmtp-local.c b/src/lmtp/lmtp-local.c index 083636ea3e..5cc29b4021 100644 --- a/src/lmtp/lmtp-local.c +++ b/src/lmtp/lmtp-local.c @@ -241,9 +241,8 @@ lmtp_local_rcpt_anvil_finish(struct lmtp_local_recipient *llrcpt) { struct smtp_server_recipient *rcpt = llrcpt->rcpt->rcpt; struct smtp_server_cmd_ctx *cmd = rcpt->cmd; - int ret; - if ((ret = lmtp_local_rcpt_check_quota(llrcpt)) < 0) + if (lmtp_local_rcpt_check_quota(llrcpt) < 0) return FALSE; smtp_server_cmd_rcpt_reply_success(cmd); diff --git a/src/log/doveadm-connection.c b/src/log/doveadm-connection.c index 8156ed61dc..6ad13ffd43 100644 --- a/src/log/doveadm-connection.c +++ b/src/log/doveadm-connection.c @@ -48,9 +48,7 @@ static int doveadm_connection_send_errors(struct doveadm_connection *conn) static int doveadm_output(struct doveadm_connection *conn) { - int ret; - - if ((ret = o_stream_flush(conn->output)) != 0) { + if (o_stream_flush(conn->output) != 0) { /* error / finished */ doveadm_connection_destroy(&conn); } diff --git a/src/master/test-auth-master.c b/src/master/test-auth-master.c index 4578f62e0d..d08b178199 100644 --- a/src/master/test-auth-master.c +++ b/src/master/test-auth-master.c @@ -1197,7 +1197,6 @@ static int test_client_user_list_simple(void) struct auth_master_user_list_ctx *list_ctx; enum auth_master_flags flags = 0; struct auth_user_info info; - const char *user; int ret; i_zero(&info); @@ -1210,7 +1209,7 @@ static int test_client_user_list_simple(void) auth_conn = auth_master_init(TEST_SOCKET, flags); auth_master_set_timeout(auth_conn, 1000); list_ctx = auth_master_user_list_init(auth_conn, "*", &info); - while ((user = auth_master_user_list_next(list_ctx)) != NULL); + while (auth_master_user_list_next(list_ctx) != NULL); ret = auth_master_user_list_deinit(&list_ctx); auth_master_deinit(&auth_conn); diff --git a/src/plugins/fts/fts-expunge-log.c b/src/plugins/fts/fts-expunge-log.c index bcb9d40f36..82760f2021 100644 --- a/src/plugins/fts/fts-expunge-log.c +++ b/src/plugins/fts/fts-expunge-log.c @@ -319,7 +319,7 @@ fts_expunge_log_write(struct fts_expunge_log_append_ctx *ctx) /* the file was opened with O_APPEND, so this write() should be appended atomically without any need for locking. */ for (;;) { - if ((ret = write_full(log->fd, buf->data, buf->used)) < 0) { + if (write_full(log->fd, buf->data, buf->used) < 0) { i_error("write(%s) failed: %m", log->path); if (ftruncate(log->fd, log->st.st_size) < 0) i_error("ftruncate(%s) failed: %m", log->path); diff --git a/src/plugins/mail-crypt/doveadm-mail-crypt.c b/src/plugins/mail-crypt/doveadm-mail-crypt.c index 78e66a2470..409a9d69b4 100644 --- a/src/plugins/mail-crypt/doveadm-mail-crypt.c +++ b/src/plugins/mail-crypt/doveadm-mail-crypt.c @@ -179,9 +179,9 @@ static int mcp_update_shared_keys(struct doveadm_mail_cmd_context *ctx, t_array_init(&ids, 8); /* figure out who needs the key */ - if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(), - MAIL_ATTRIBUTE_TYPE_SHARED, - &ids, &error)) < 0) { + if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(), + MAIL_ATTRIBUTE_TYPE_SHARED, + &ids, &error) < 0) { i_error("mail_crypt_box_get_pvt_digests(%s, /shared) failed: %s", mailbox_get_vname(box), error); @@ -272,8 +272,8 @@ static int mcp_keypair_generate(struct mcp_cmd_context *ctx, FIXME: this could be less confusing altogether */ ret = 0; } else { - if ((ret = mail_crypt_box_generate_keypair(box, &pair, - user_key, pubid_r, error_r)) < 0) { + if (mail_crypt_box_generate_keypair(box, &pair, user_key, + pubid_r, error_r) < 0) { ret = -1; } else { *pubid_r = p_strdup(ctx->ctx.pool, *pubid_r); @@ -490,7 +490,6 @@ static void mcp_key_list(struct mcp_cmd_context *ctx, void *context) { const char *error; - int ret; /* we need to use the mailbox attribute API here, as we are not necessarily able to decrypt any of these keys @@ -508,10 +507,9 @@ static void mcp_key_list(struct mcp_cmd_context *ctx, struct mail_attribute_value value; i_zero(&value); - if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED, - USER_CRYPT_PREFIX - ACTIVE_KEY_NAME, - &value)) < 0) { + if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED, + USER_CRYPT_PREFIX ACTIVE_KEY_NAME, + &value) < 0) { i_error("mailbox_get_attribute(%s, %s) failed: %s", mailbox_get_vname(box), USER_CRYPT_PREFIX ACTIVE_KEY_NAME, @@ -563,17 +561,16 @@ static void mcp_key_list(struct mcp_cmd_context *ctx, array_clear(&ids); /* get active ID */ - if ((ret = mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED, - BOX_CRYPT_PREFIX - ACTIVE_KEY_NAME, - &value)) < 0) { + if (mailbox_attribute_get(box, MAIL_ATTRIBUTE_TYPE_SHARED, + BOX_CRYPT_PREFIX ACTIVE_KEY_NAME, + &value) < 0) { i_error("mailbox_get_attribute(%s, %s) failed: %s", mailbox_get_vname(box), BOX_CRYPT_PREFIX ACTIVE_KEY_NAME, mailbox_get_last_internal_error(box, NULL)); - } else if ((ret = mail_crypt_box_get_pvt_digests(box, pool_datastack_create(), - MAIL_ATTRIBUTE_TYPE_PRIVATE, - &ids, &error)) < 0) { + } else if (mail_crypt_box_get_pvt_digests(box, pool_datastack_create(), + MAIL_ATTRIBUTE_TYPE_PRIVATE, + &ids, &error) < 0) { i_error("mail_crypt_box_get_pvt_digests(%s) failed: %s", mailbox_get_vname(box), error);