From: Timo Sirainen Date: Thu, 17 Aug 2017 10:20:26 +0000 (+0300) Subject: global: Add/change switch case "fall through" comments X-Git-Tag: 2.3.0.rc1~1156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f784d5bb8edbec88829524135cfa100129f5384d;p=thirdparty%2Fdovecot%2Fcore.git global: Add/change switch case "fall through" comments These fix warnings with gcc 7's -Wimplicit-fallthrough --- diff --git a/src/auth/password-scheme.c b/src/auth/password-scheme.c index ea9454e517..3e050287d4 100644 --- a/src/auth/password-scheme.c +++ b/src/auth/password-scheme.c @@ -175,9 +175,9 @@ int password_decode(const char *password, const char *scheme, *error_r = "Input isn't valid HEX encoded data"; return -1; } - /* fall through, just in case it was base64-encoded after - all. some input lengths produce matching hex and base64 - encoded lengths. */ + /* check if it's base64-encoded after all. some input lengths + produce matching hex and base64 encoded lengths. */ + /* fall through */ case PW_ENCODING_BASE64: buf = buffer_create_dynamic(pool_datastack_create(), MAX_BASE64_DECODED_SIZE(len)); diff --git a/src/lib-fts/fts-filter-contractions.c b/src/lib-fts/fts-filter-contractions.c index 9653a71b88..7f728cd61b 100644 --- a/src/lib-fts/fts-filter-contractions.c +++ b/src/lib-fts/fts-filter-contractions.c @@ -45,7 +45,7 @@ fts_filter_contractions_filter(struct fts_filter *filter ATTR_UNUSED, pos++; if (token[pos] == '\0' || token[pos] != 'u') break; - /* otherwise fall through */ + /* fall through */ case 'c': case 'd': case 'j': diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 2ecf9ed0ad..1dddff9208 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -1065,6 +1065,7 @@ void mail_transaction_update_modseq(const struct mail_transaction_header *hdr, /* ignore expunge requests */ break; } + /* fall through */ case MAIL_TRANSACTION_APPEND: case MAIL_TRANSACTION_KEYWORD_UPDATE: case MAIL_TRANSACTION_KEYWORD_RESET: diff --git a/src/lib-ldap/ldap-connection.c b/src/lib-ldap/ldap-connection.c index bdd651d450..e9991a92b9 100644 --- a/src/lib-ldap/ldap-connection.c +++ b/src/lib-ldap/ldap-connection.c @@ -481,10 +481,9 @@ ldap_connect_next_message(struct ldap_connection *conn, } conn->state = LDAP_STATE_TLS; break; - } else { - conn->state = LDAP_STATE_AUTH; - /* we let it slide intentionally to next case */ } + conn->state = LDAP_STATE_AUTH; + /* fall through */ case LDAP_STATE_AUTH: ret = ldap_sasl_bind(conn->conn, conn->set.bind_dn, diff --git a/src/lib-mail/istream-attachment-extractor.c b/src/lib-mail/istream-attachment-extractor.c index 59840a911c..a1ea7f136f 100644 --- a/src/lib-mail/istream-attachment-extractor.c +++ b/src/lib-mail/istream-attachment-extractor.c @@ -326,7 +326,7 @@ static void astream_add_body(struct attachment_istream *astream, o_stream_nsend(part->temp_output, part_buf->data, part_buf->used); buffer_set_used_size(part_buf, 0); - /* fall through to write the new data to temp file */ + /* fall through - write the new data to temp file */ case MAIL_ATTACHMENT_STATE_YES: astream_try_base64_decode(part, block->data, block->size); hash_format_loop(astream->set.hash_format, diff --git a/src/lib-mail/message-header-encode.c b/src/lib-mail/message-header-encode.c index 46bbb9b9ff..4fef8f4fa4 100644 --- a/src/lib-mail/message-header-encode.c +++ b/src/lib-mail/message-header-encode.c @@ -19,7 +19,7 @@ static bool input_idx_need_encoding(const unsigned char *input, if (i+1 == len || input[i+1] != '\n') return TRUE; i++; - /* fall through and verify the LF as well */ + /* fall through - verify the LF as well */ case '\n': if (i+1 == len) { /* trailing LF - we need to drop it */ diff --git a/src/lib-storage/index/imapc/imapc-search.c b/src/lib-storage/index/imapc/imapc-search.c index 15905191bf..ef36253518 100644 --- a/src/lib-storage/index/imapc/imapc-search.c +++ b/src/lib-storage/index/imapc/imapc-search.c @@ -106,7 +106,7 @@ imapc_build_search_query_arg(struct imapc_mailbox *mbox, return FALSE; return TRUE; } - /* fall thrugh */ + /* fall through */ case SEARCH_ALL: case SEARCH_UIDSET: case SEARCH_FLAGS: diff --git a/src/lib-storage/mail-search.c b/src/lib-storage/mail-search.c index 1362bf89b0..5af50d907a 100644 --- a/src/lib-storage/mail-search.c +++ b/src/lib-storage/mail-search.c @@ -77,7 +77,7 @@ void mail_search_arg_init(struct mail_search_args *args, case SEARCH_MODSEQ: if (arg->value.str == NULL) break; - /* modseq with keyword */ + /* fall through - modseq with keyword */ case SEARCH_KEYWORDS: keywords[0] = arg->value.str; keywords[1] = NULL; diff --git a/src/lib/json-parser.c b/src/lib/json-parser.c index 685b4bc8ac..bdefd6d8ec 100644 --- a/src/lib/json-parser.c +++ b/src/lib/json-parser.c @@ -538,6 +538,7 @@ json_try_parse_next(struct json_parser *parser, enum json_type *type_r, /* we skipped over the previous value */ parser->skipping = FALSE; } + /* fall through */ case JSON_STATE_ARRAY_NEXT_SKIP: if (*parser->data == ']') return json_parse_close_array(parser, type_r); diff --git a/src/plugins/fts/fts-search-args.c b/src/plugins/fts/fts-search-args.c index b07ddd7cf4..e66788872b 100644 --- a/src/plugins/fts/fts-search-args.c +++ b/src/plugins/fts/fts-search-args.c @@ -208,6 +208,7 @@ fts_search_args_expand_tree(struct fts_backend *backend, pool_t pool, the header */ break; } + /* fall through */ case SEARCH_BODY: case SEARCH_TEXT: T_BEGIN {