Welcome! Log In Create A New Profile

Advanced

[nginx] Added missing "fall through" comments (ticket #1259).

Maxim Dounin
October 17, 2017 08:52AM
details: http://hg.nginx.org/nginx/rev/d409ab1e8e4d
branches: stable-1.12
changeset: 7136:d409ab1e8e4d
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Apr 27 16:57:18 2017 +0300
description:
Added missing "fall through" comments (ticket #1259).

Found by gcc7 (-Wimplicit-fallthrough).

diffstat:

src/core/ngx_murmurhash.c | 2 ++
src/http/ngx_http_parse.c | 3 +++
src/os/unix/ngx_process.c | 1 +
3 files changed, 6 insertions(+), 0 deletions(-)

diffs (52 lines):

diff --git a/src/core/ngx_murmurhash.c b/src/core/ngx_murmurhash.c
--- a/src/core/ngx_murmurhash.c
+++ b/src/core/ngx_murmurhash.c
@@ -35,8 +35,10 @@ ngx_murmur_hash2(u_char *data, size_t le
switch (len) {
case 3:
h ^= data[2] << 16;
+ /* fall through */
case 2:
h ^= data[1] << 8;
+ /* fall through */
case 1:
h ^= data[0];
h *= 0x5bd1e995;
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -1390,6 +1390,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
goto done;
case '+':
r->plus_in_uri = 1;
+ /* fall through */
default:
state = sw_usual;
*u++ = ch;
@@ -1431,6 +1432,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
goto done;
case '+':
r->plus_in_uri = 1;
+ /* fall through */
default:
state = sw_usual;
*u++ = ch;
@@ -1478,6 +1480,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
goto done;
case '+':
r->plus_in_uri = 1;
+ /* fall through */
default:
state = sw_usual;
*u++ = ch;
diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c
--- a/src/os/unix/ngx_process.c
+++ b/src/os/unix/ngx_process.c
@@ -405,6 +405,7 @@ ngx_signal_handler(int signo)
break;
}
ngx_debug_quit = 1;
+ /* fall through */
case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
ngx_quit = 1;
action = ", shutting down";
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Added missing "fall through" comments (ticket #1259).

Maxim Dounin 343 October 17, 2017 08:52AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready