]> 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)
committerTimo Sirainen <tss@dovecot.fi>
Thu, 17 Aug 2017 11:59:14 +0000 (14:59 +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 ea9454e517bfee4aa0f68682471cb6be73c6a648..3e050287d4eda30088a42a12ee54edc35e85356e 100644 (file)
@@ -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));
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 2ecf9ed0ad476e5ac24c77ad8920d1e23d2914b3..1dddff92089d4d6a5e350b4049a2dbc919d17e12 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 bdd651d45093ca1d394c99c59005ed0abe9ae7d7..e9991a92b9b75691f24d651a9baaaef12f226f18 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 59840a911c829c6db1b6a4061e244ebbc85292a8..a1ea7f136f9438f674fbe269bbee40d0ecce3134 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 1362bf89b07806e47930036471d41f744bf66adf..5af50d907abc6d1c598ac820396f1fafbed2d208 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 {