]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Add/change switch case "fall through" comments
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 17 Aug 2017 10:20:26 +0000 (13:20 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Sep 2017 08:43:43 +0000 (11:43 +0300)
These fix warnings with gcc 7's -Wimplicit-fallthrough

src/auth/password-scheme.c
src/lib-fts/fts-filter-contractions.c
src/lib-index/mail-transaction-log-file.c
src/lib-ldap/ldap-connection.c
src/lib-mail/istream-attachment-extractor.c
src/lib-mail/message-header-encode.c
src/lib-storage/index/imapc/imapc-search.c
src/lib-storage/mail-search.c
src/lib/json-parser.c
src/plugins/fts/fts-search-args.c

index 1325fc487fd6340ec8669060702256a32463a086..1c9d47e5b1488dc934f4662fda5e1f70cff7e678 100644 (file)
@@ -187,9 +187,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));
index 9653a71b883a703f0ddebf2c46dcd396f912cdb4..7f728cd61b017dfe1201247406f59858e98d9f3d 100644 (file)
@@ -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':
index 82723fe3a2fad91aefd685b49b220132b1786bea..40b66c0b2fecb8752887dda370125f863b40729f 100644 (file)
@@ -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:
index 103816a2839b7f125dc30c702efeef4d47566ec5..ca9f41040a9fe24622727de45664f3c3d7629ad5 100644 (file)
@@ -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,
index eed2a00ea507bb2401d7882f7dec49d5270cf438..3925f18225d92c58adf38e3d06cdf34c46dc452e 100644 (file)
@@ -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,
index 46bbb9b9ffc8322ab0795fb89a28c12acf6efa80..4fef8f4fa4578434dd9cdfdcb785b632934c5a1f 100644 (file)
@@ -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 */
index 15905191bfcab0f632ebb1d064f82e84b6f802a8..ef3625351851326a79fe57d4bb31ceeb757c42c5 100644 (file)
@@ -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:
index 28b9fec539edddaf1fe58c1c342a3b2468be0a6e..652ee6a0edf6b66c286d08701a608d6c9d5f750f 100644 (file)
@@ -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;
index 685b4bc8ac9da6f1a13a80c20eab623a5a4b52e3..bdefd6d8ec2f5e3434dfb8d03efe9166cf0de435 100644 (file)
@@ -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);
index b07ddd7cf422cc91c81d4ce6b7b4ee52bac61142..e66788872bc3ef99084a23a71086b5c46c97ce04 100644 (file)
@@ -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 {