From aeed676c0852c51429c261149cb1293698c9a3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 21 Aug 2020 05:50:02 +0200 Subject: [PATCH] Replace a bunch of fallthrough comments with an attribute Parsing comments is hack and clang doesn't do it, so switch to G_GNUC_FALLTHROUGH, which exists for exactly this case. --- glib/giounix.c | 2 +- glib/gscanner.c | 4 ++-- glib/gvariant.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glib/giounix.c b/glib/giounix.c index 6ba442f15..b86d79db7 100644 --- a/glib/giounix.c +++ b/glib/giounix.c @@ -491,7 +491,7 @@ g_io_channel_new_file (const gchar *filename, mode_num |= MODE_PLUS; break; } - /* Fall through */ + G_GNUC_FALLTHROUGH; default: g_warning ("Invalid GIOFileMode %s.", mode); return NULL; diff --git a/glib/gscanner.c b/glib/gscanner.c index e2c6aa4c4..b77514afe 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -1378,7 +1378,7 @@ g_scanner_unexp_token (GScanner *scanner, _g_snprintf (token_string, token_string_len, "(unknown) token <%d>", scanner->token); break; } - /* fall through */ + G_GNUC_FALLTHROUGH; case G_TOKEN_SYMBOL: if (expected_token == G_TOKEN_SYMBOL || (scanner->config->symbol_2_token && @@ -1523,7 +1523,7 @@ g_scanner_unexp_token (GScanner *scanner, _g_snprintf (expected_string, expected_string_len, "(unknown) token <%d>", expected_token); break; } - /* fall through */ + G_GNUC_FALLTHROUGH; case G_TOKEN_SYMBOL: need_valid = (scanner->token == G_TOKEN_SYMBOL || (scanner->config->symbol_2_token && diff --git a/glib/gvariant.c b/glib/gvariant.c index e4b1d4574..6b460d843 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -4930,7 +4930,7 @@ g_variant_valist_get_nnp (const gchar **str, case '@': g_variant_type_string_scan (*str, NULL, str); - /* fall through */ + G_GNUC_FALLTHROUGH; case '*': case '?':