Fix warnings 'implicit-fallthrough' of gcc 7
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 5 Sep 2017 12:35:13 +0000 (14:35 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 5 Sep 2017 12:35:13 +0000 (14:35 +0200)
Change-Id: I32b42fd8db481fcbdce4b934fc990c118293850d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afm-launch.c
src/afm-system-daemon.c
src/mustach.c
src/wgtpkg-mustach.c

index d80e43b..1a354a1 100644 (file)
@@ -610,6 +610,7 @@ static union arguments instantiate_arguments(
                                                break;
                                        case '%':
                                                c = 0;
+                                               /*@fallthrough@*/
                                        default:
                                                mini[1] = c;
                                                v = mini;
index 49749bc..e0557f4 100644 (file)
@@ -103,6 +103,7 @@ static void on_install(struct sd_bus_message *smsg, struct json_object *req, voi
                        reload = j_boolean_at(req, "reload", 1);
                        break;
                }
+               /*@fallthrough@*/
        default:
                jbus_reply_error_s(smsg, error_bad_request);
                return;
@@ -150,6 +151,7 @@ static void on_uninstall(struct sd_bus_message *smsg, struct json_object *req, v
                        root = j_string_at(req, "root", rootdir);
                        break;
                }
+               /*@fallthrough@*/
        default:
                jbus_reply_error_s(smsg, error_bad_request);
                return;
index 03f3cb1..9868cff 100644 (file)
@@ -99,6 +99,7 @@ static int process(const char *template, struct mustach_itf *itf, void *closure,
                                template++;
                        }
                        c = '&';
+                       /*@fallthrough@*/
                case '^':
                case '#':
                case '/':
index 45d94e8..4251427 100644 (file)
@@ -62,8 +62,8 @@ static char *keyval(char *read, int isptr)
                } else {
                        if (c == '\\') {
                                switch (read[1]) {
-                               case '\\': *write++ = c;
-                               case '=': c = *++read;
+                               case '\\': *write++ = c; /*@fallthrough@*/
+                               case '=': c = *++read; /*@fallthrough@*/
                                default: break;
                                }
                        }
@@ -92,8 +92,8 @@ static char *first(char **name, int isptr)
                        while (c && c != '/') {
                                if (c == '~') {
                                        switch(read[1]) {
-                                       case '1': c = '/';
-                                       case '0': read++;
+                                       case '1': c = '/'; /*@fallthrough@*/
+                                       case '0': read++; /*@fallthrough@*/
                                        default: break;
                                        }
                                }