From 513913fac6d36ca3b09500865eafa8836e806a94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Mon, 31 Jul 2017 16:46:23 +0200 Subject: [PATCH] Fix fallthrough warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ibe8e0b4e59ad4d5f0b0cca82ccdb3d0f035b0501 Signed-off-by: José Bollo --- src/afb-api.c | 1 + src/main.c | 2 +- src/websock.c | 4 ++++ src/wrap-json.c | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/afb-api.c b/src/afb-api.c index bb172d7e..38ec4f25 100644 --- a/src/afb-api.c +++ b/src/afb-api.c @@ -44,6 +44,7 @@ int afb_api_is_valid_name(const char *name) default: if (c > ' ') break; + /*@fallthrough@*/ case '"': case '#': case '%': diff --git a/src/main.c b/src/main.c index 77392f83..dee79d86 100644 --- a/src/main.c +++ b/src/main.c @@ -351,7 +351,7 @@ static char *instanciate_string(char *arg, const char *port, const char *token) switch(*++it) { case 'p': wr = stpcpy(wr, port); break; case 't': wr = stpcpy(wr, token); break; - default: *wr++ = SUBST_CHAR; + default: *wr++ = SUBST_CHAR; /*@fallthrough@*/ case SUBST_CHAR: *wr++ = *it; } arg = ++it; diff --git a/src/websock.c b/src/websock.c index 1b127c8b..0bbd56ac 100644 --- a/src/websock.c +++ b/src/websock.c @@ -312,6 +312,7 @@ loop: ws->lenhead = 0; ws->szhead = 2; ws->state = STATE_START; + /*@fallthrough@*/ case STATE_START: /* read the header */ @@ -342,12 +343,15 @@ loop: switch (FRAME_GET_PAYLOAD_LEN(ws->header[1])) { case 127: ws->szhead += 6; + /*@fallthrough@*/ case 126: ws->szhead += 2; + /*@fallthrough@*/ default: ws->szhead += 4 * FRAME_GET_MASK(ws->header[1]); } ws->state = STATE_LENGTH; + /*@fallthrough@*/ case STATE_LENGTH: /* continue to read the header */ diff --git a/src/wrap-json.c b/src/wrap-json.c index 271a825a..164e127d 100644 --- a/src/wrap-json.c +++ b/src/wrap-json.c @@ -525,6 +525,7 @@ static int vunpack(struct json_object *object, const char *desc, va_list args, i goto invalid_character; if (!ignore && top->index != top->count) goto incomplete; + /*@fallthrough@*/ case '*': acc = xacc; continue; -- 2.16.6