[gnome-settings-daemon] media-keys: Shut up a compiler warning



commit 93a74508159e53384b7146b3c19b38079be5fc1a
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jan 27 12:43:28 2021 +0100

    media-keys: Shut up a compiler warning
    
    Apparently gcc is unhappy that a switch statement doesn't handle future
    enum additions:
    
    warning: ‘action’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    Shut it up with an appropriate default case.

 plugins/media-keys/gsd-media-keys-manager.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 42fa14da..2e054993 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2287,6 +2287,9 @@ do_config_power_button_action (GsdMediaKeysManager *manager,
         case GSD_POWER_BUTTON_ACTION_INTERACTIVE:
                 action = GSD_POWER_ACTION_INTERACTIVE;
                 break;
+        default:
+                g_warn_if_reached ();
+                G_GNUC_FALLTHROUGH;
         case GSD_POWER_BUTTON_ACTION_NOTHING:
                 /* do nothing */
                 return;


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