summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2018-10-12 22:09:42 +0100
committerDaniel Boles <dboles.src@gmail.com>2018-10-12 22:19:25 +0100
commit9cbd3ac017a993889c5c663603db7867e0d4ed13 (patch)
treec94df1182cc039b496cfd647f664425edba4a1ed /demos
parentae3e6d194924a0369e824c1172fd34398ee5cd22 (diff)
downloadgtk+-9cbd3ac017a993889c5c663603db7867e0d4ed13.tar.gz
gtk-demo/main: Suppress implicit fallthru warning
Comments matched to reassure the compiler that fallthrough is intentional are supposed to precede the case or default keywords, at least in GCC, so the one here did not suppress the warning with GCC. We can just the if condition and put the comment at the end to solve that. https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 98f730ae74..ba2f1a25c1 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -831,15 +831,14 @@ load_file (const gchar *demoname,
/* Skipping blank lines */
while (g_ascii_isspace (*p))
p++;
- if (*p)
- {
- p = lines[i];
- state++;
- /* Fall through */
- }
- else
+
+ if (!*p)
break;
+ p = lines[i];
+ state++;
+ /* Fall through */
+
case 3:
/* Reading program body */
gtk_text_buffer_insert (source_buffer, &start, p, -1);