Mercurial > dovecot > core-2.2
changeset 22465:ff8873d5675a
global: Add/change switch case "fall through" comments
These fix warnings with gcc 7's -Wimplicit-fallthrough
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Thu, 17 Aug 2017 13:20:26 +0300 |
parents | 05b48dab5d29 |
children | df0a2f4282f8 |
files | 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 |
diffstat | 10 files changed, 13 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/password-scheme.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/auth/password-scheme.c Thu Aug 17 13:20:26 2017 +0300 @@ -187,9 +187,9 @@ *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));
--- a/src/lib-fts/fts-filter-contractions.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-fts/fts-filter-contractions.c Thu Aug 17 13:20:26 2017 +0300 @@ -45,7 +45,7 @@ pos++; if (token[pos] == '\0' || token[pos] != 'u') break; - /* otherwise fall through */ + /* fall through */ case 'c': case 'd': case 'j':
--- a/src/lib-index/mail-transaction-log-file.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-index/mail-transaction-log-file.c Thu Aug 17 13:20:26 2017 +0300 @@ -1065,6 +1065,7 @@ /* ignore expunge requests */ break; } + /* fall through */ case MAIL_TRANSACTION_APPEND: case MAIL_TRANSACTION_KEYWORD_UPDATE: case MAIL_TRANSACTION_KEYWORD_RESET:
--- a/src/lib-ldap/ldap-connection.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-ldap/ldap-connection.c Thu Aug 17 13:20:26 2017 +0300 @@ -481,10 +481,9 @@ } 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,
--- a/src/lib-mail/istream-attachment-extractor.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-mail/istream-attachment-extractor.c Thu Aug 17 13:20:26 2017 +0300 @@ -326,7 +326,7 @@ 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,
--- a/src/lib-mail/message-header-encode.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-mail/message-header-encode.c Thu Aug 17 13:20:26 2017 +0300 @@ -19,7 +19,7 @@ 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 */
--- a/src/lib-storage/index/imapc/imapc-search.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-storage/index/imapc/imapc-search.c Thu Aug 17 13:20:26 2017 +0300 @@ -106,7 +106,7 @@ return FALSE; return TRUE; } - /* fall thrugh */ + /* fall through */ case SEARCH_ALL: case SEARCH_UIDSET: case SEARCH_FLAGS:
--- a/src/lib-storage/mail-search.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib-storage/mail-search.c Thu Aug 17 13:20:26 2017 +0300 @@ -77,7 +77,7 @@ 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;
--- a/src/lib/json-parser.c Thu Aug 17 14:42:07 2017 +0300 +++ b/src/lib/json-parser.c Thu Aug 17 13:20:26 2017 +0300 @@ -538,6 +538,7 @@ /* 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);