[gnome-applets/wip/muktupavels/werror] multiload: fix -Wunused-but-set-variable warnings



commit 100ccf9527e0bfa08a20d360b83f97290dc35872
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Apr 4 19:53:51 2020 +0300

    multiload: fix -Wunused-but-set-variable warnings

 gnome-applets/multiload/linux-proc.c | 7 ++-----
 gnome-applets/multiload/load-graph.c | 3 ---
 2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/gnome-applets/multiload/linux-proc.c b/gnome-applets/multiload/linux-proc.c
index 8094a965f..0120fdb9b 100644
--- a/gnome-applets/multiload/linux-proc.c
+++ b/gnome-applets/multiload/linux-proc.c
@@ -236,7 +236,7 @@ GetMemory (int Maximum, int data [5], LoadGraph *g)
 void
 GetSwap (int Maximum, int data [2], LoadGraph *g)
 {
-    int used, free;
+    int used;
 
     glibtop_swap swap;
 
@@ -245,11 +245,9 @@ GetSwap (int Maximum, int data [2], LoadGraph *g)
 
     if (swap.total == 0) {
        used = 0;
-       free = Maximum;
     }
     else {
        used    = rint (Maximum * (float)swap.used / swap.total);
-       free    = rint (Maximum * (float)swap.free / swap.total);
     }
 
     data [0] = used;
@@ -262,7 +260,7 @@ GetLoadAvg (int Maximum, int data [2], LoadGraph *g)
     const float per_cpu_max_loadavg = 5.0f;
     float max_loadavg;
     float loadavg1;
-    float used, free;
+    float used;
 
     glibtop_loadavg loadavg;
     glibtop_get_loadavg (&loadavg);
@@ -275,7 +273,6 @@ GetLoadAvg (int Maximum, int data [2], LoadGraph *g)
     loadavg1 = MIN(loadavg.loadavg[0], max_loadavg);
 
     used    = loadavg1 / max_loadavg;
-    free    = (max_loadavg - loadavg1) / max_loadavg;
 
     data [0] = rint ((float) Maximum * used);
     data [1] = Maximum - data[0];
diff --git a/gnome-applets/multiload/load-graph.c b/gnome-applets/multiload/load-graph.c
index 32475536d..12c733f28 100644
--- a/gnome-applets/multiload/load-graph.c
+++ b/gnome-applets/multiload/load-graph.c
@@ -44,7 +44,6 @@ shift_right(LoadGraph *g)
 static void
 load_graph_draw_graph (LoadGraph *g)
 {
-    GtkStyle *style;
     guint i, j;
     cairo_t *cr;
 
@@ -56,8 +55,6 @@ load_graph_draw_graph (LoadGraph *g)
                g->surface = gdk_window_create_similar_surface (gtk_widget_get_window (g->disp),
                                                                CAIRO_CONTENT_COLOR,
                                                                 g->draw_width, g->draw_height);
-       
-    style = gtk_widget_get_style (g->disp);
 
     cr = cairo_create (g->surface);
     cairo_set_line_width (cr, 1.0);


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