[gnome-applets] battstat: fix -Wdeclaration-after-statement warnings



commit 117739ccfc2a0ff14b3ff9085073dc5c6c99993c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Apr 3 21:11:49 2020 +0300

    battstat: fix -Wdeclaration-after-statement warnings

 gnome-applets/battstat/battstat-applet.c | 13 +++++++------
 gnome-applets/battstat/battstat-upower.c |  3 ++-
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gnome-applets/battstat/battstat-applet.c b/gnome-applets/battstat/battstat-applet.c
index aa1d39480..74b72b284 100644
--- a/gnome-applets/battstat/battstat-applet.c
+++ b/gnome-applets/battstat/battstat-applet.c
@@ -369,6 +369,7 @@ get_remaining (BatteryStatus *info)
 static gboolean
 battery_full_notify (GtkWidget *applet)
 {
+       NotifyNotification *n;
        GError *error = NULL;
        GdkPixbuf *icon;
        gboolean result;
@@ -382,8 +383,8 @@ battery_full_notify (GtkWidget *applet)
                        48,
                        GTK_ICON_LOOKUP_USE_BUILTIN,
                        NULL);
-       
-       NotifyNotification *n = notify_notification_new (_("Your battery is now fully recharged"), "", /* 
"battery" */ NULL);
+
+       n = notify_notification_new (_("Your battery is now fully recharged"), "", /* "battery" */ NULL);
 
        /* XXX: it would be nice to pass this as a named icon */
        notify_notification_set_icon_from_pixbuf (n, icon);
@@ -407,14 +408,14 @@ battery_full_notify (GtkWidget *applet)
 static void
 battery_full_dialog (GtkWidget *applet)
 {
+  GtkWidget *dialog, *hbox, *image, *label;
+  GdkPixbuf *pixbuf;
+  gchar *new_label;
+
   /* first attempt to use libnotify */
   if (battery_full_notify (applet))
          return;
-  
-  GtkWidget *dialog, *hbox, *image, *label;
-  GdkPixbuf *pixbuf;
 
-  gchar *new_label;
   dialog = gtk_dialog_new_with_buttons (
                _("Battery Notice"),
                NULL,
diff --git a/gnome-applets/battstat/battstat-upower.c b/gnome-applets/battstat/battstat-upower.c
index 235833f9e..b44199c7d 100644
--- a/gnome-applets/battstat/battstat-upower.c
+++ b/gnome-applets/battstat/battstat-upower.c
@@ -74,9 +74,10 @@ device_removed_cb (UpClient *client, const gchar *object_path, gpointer user_dat
 const char *
 battstat_upower_initialise (void (*callback) (void))
 {
-  status_updated_callback = callback;
   GPtrArray *devices;
 
+  status_updated_callback = callback;
+
   if( upc != NULL )
     return "Already initialised!";
 


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