[xdg-desktop-portal-gnome/mwleeds/use-gnuc-fallthrough: 30/30] Use G_GNUC_FALLTHROUGH more




commit f6318461bb03ed38070d68e76e3bf4fe69cbc3dc
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Tue Mar 15 13:52:10 2022 -0700

    Use G_GNUC_FALLTHROUGH more
    
    This helps compilers know a fall through in a switch statement case is
    intentional. Also fix some whitespace.

 src/account.c       |  3 ++-
 src/accountdialog.c |  3 ++-
 src/filechooser.c   |  3 ++-
 src/print.c         | 10 ++++++----
 src/remotedesktop.c |  3 ++-
 src/screencast.c    |  3 ++-
 src/screenshot.c    |  3 ++-
 src/wallpaper.c     | 30 ++++++++++++++++--------------
 8 files changed, 34 insertions(+), 24 deletions(-)
---
diff --git a/src/account.c b/src/account.c
index 372bdf1..cf0ded9 100644
--- a/src/account.c
+++ b/src/account.c
@@ -101,7 +101,8 @@ account_dialog_done (GtkWidget  *widget,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       handle->response = 2;
       break;
diff --git a/src/accountdialog.c b/src/accountdialog.c
index 6f5577e..d0c6251 100644
--- a/src/accountdialog.c
+++ b/src/accountdialog.c
@@ -125,7 +125,8 @@ file_chooser_response (GtkWidget *widget,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
     case GTK_RESPONSE_CANCEL:
       break;
diff --git a/src/filechooser.c b/src/filechooser.c
index 7ff8068..84add23 100644
--- a/src/filechooser.c
+++ b/src/filechooser.c
@@ -265,7 +265,8 @@ file_chooser_response (GtkWidget *widget,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       handle->response = 2;
       handle->filter = NULL;
diff --git a/src/print.c b/src/print.c
index 60722cb..327e228 100644
--- a/src/print.c
+++ b/src/print.c
@@ -340,7 +340,8 @@ handle_print_response (GtkDialog *dialog,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       handle->response = 2;
       break;
@@ -351,7 +352,7 @@ handle_print_response (GtkDialog *dialog,
 
     case GTK_RESPONSE_APPLY:
       preview = TRUE;
-      /* fall thru */
+      G_GNUC_FALLTHROUGH;
 
     case GTK_RESPONSE_OK:
       {
@@ -575,7 +576,8 @@ handle_prepare_print_response (GtkDialog *dialog,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       handle->response = 2;
       break;
@@ -586,7 +588,7 @@ handle_prepare_print_response (GtkDialog *dialog,
 
     case GTK_RESPONSE_APPLY:
       preview = TRUE;
-      /* fall thru */
+      G_GNUC_FALLTHROUGH;
 
     case GTK_RESPONSE_OK:
       {
diff --git a/src/remotedesktop.c b/src/remotedesktop.c
index 46d1dcc..30f1960 100644
--- a/src/remotedesktop.c
+++ b/src/remotedesktop.c
@@ -168,7 +168,8 @@ remote_desktop_dialog_done (GtkWidget                 *widget,
     {
     default:
       g_warning ("Unexpected response: %d", dialog_response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       response = 2;
       break;
diff --git a/src/screencast.c b/src/screencast.c
index 3918f31..46e1dfd 100644
--- a/src/screencast.c
+++ b/src/screencast.c
@@ -306,7 +306,8 @@ on_screen_cast_dialog_done_cb (GtkWidget              *widget,
     {
     default:
       g_warning ("Unexpected response: %d", dialog_response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       response = 2;
       break;
diff --git a/src/screenshot.c b/src/screenshot.c
index c8ec985..5d49cdc 100644
--- a/src/screenshot.c
+++ b/src/screenshot.c
@@ -109,7 +109,8 @@ screenshot_dialog_done (GtkWidget *widget,
     {
     default:
       g_warning ("Unexpected response: %d", response);
-      /* Fall through */
+      G_GNUC_FALLTHROUGH;
+
     case GTK_RESPONSE_DELETE_EVENT:
       handle->response = 2;
       break;
diff --git a/src/wallpaper.c b/src/wallpaper.c
index de0f584..217a61d 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -146,20 +146,22 @@ handle_wallpaper_dialog_response (WallpaperDialog *dialog,
 
   switch (response)
     {
-      default:
-        g_warning ("Unexpected response: %d", response);
-        /* Fall through */
-      case GTK_RESPONSE_DELETE_EVENT:
-        handle->response = 2;
-        break;
-      case GTK_RESPONSE_CANCEL:
-        handle->response = 1;
-        break;
-      case GTK_RESPONSE_APPLY:
-        handle->response = 0;
-        set_wallpaper (handle, wallpaper_dialog_get_uri (dialog));
-
-        return;
+    default:
+      g_warning ("Unexpected response: %d", response);
+      G_GNUC_FALLTHROUGH;
+
+    case GTK_RESPONSE_DELETE_EVENT:
+      handle->response = 2;
+      break;
+
+    case GTK_RESPONSE_CANCEL:
+      handle->response = 1;
+      break;
+
+    case GTK_RESPONSE_APPLY:
+      handle->response = 0;
+      set_wallpaper (handle, wallpaper_dialog_get_uri (dialog));
+      return;
     }
 
   send_response (handle);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]