Fix fallthrough warnings
authorJosé Bollo <jose.bollo@iot.bzh>
Mon, 31 Jul 2017 14:46:23 +0000 (16:46 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 31 Jul 2017 14:46:23 +0000 (16:46 +0200)
Change-Id: Ibe8e0b4e59ad4d5f0b0cca82ccdb3d0f035b0501
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-api.c
src/main.c
src/websock.c
src/wrap-json.c

index bb172d7..38ec4f2 100644 (file)
@@ -44,6 +44,7 @@ int afb_api_is_valid_name(const char *name)
                        default:
                                if (c > ' ')
                                        break;
+                               /*@fallthrough@*/
                        case '"':
                        case '#':
                        case '%':
index 77392f8..dee79d8 100644 (file)
@@ -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;
index 1b127c8..0bbd56a 100644 (file)
@@ -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 */
index 271a825..164e127 100644 (file)
@@ -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;