From 11a661f6d9f554a73ccd8508ad56fdb5be5e7b91 Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 27 Nov 2014 17:07:37 +0100 Subject: multiload: Remove unused code --- multiload/linux-proc.c | 7 ++----- multiload/load-graph.c | 3 --- multiload/properties.c | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) (limited to 'multiload') diff --git a/multiload/linux-proc.c b/multiload/linux-proc.c index e1687224..13ebc5ff 100644 --- a/multiload/linux-proc.c +++ b/multiload/linux-proc.c @@ -226,7 +226,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; @@ -235,11 +235,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; @@ -252,7 +250,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); @@ -265,7 +263,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/multiload/load-graph.c b/multiload/load-graph.c index 3a15d4ba..b8d648a6 100644 --- a/multiload/load-graph.c +++ b/multiload/load-graph.c @@ -51,7 +51,6 @@ shift_right(LoadGraph *g) static void load_graph_draw (LoadGraph *g) { - GtkStyle *style; guint i, j; cairo_t *cr; @@ -64,8 +63,6 @@ load_graph_draw (LoadGraph *g) 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); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); diff --git a/multiload/properties.c b/multiload/properties.c index 9d233662..45b9eba8 100644 --- a/multiload/properties.c +++ b/multiload/properties.c @@ -226,8 +226,6 @@ color_picker_set_cb(GtkColorButton *color_picker, gchar *key) ma = g_object_get_data (G_OBJECT (color_picker), "MultiloadApplet"); - prop_type = 0; - if (strstr(key, "cpuload")) prop_type = PROP_CPU; else if (strstr(key, "memload")) -- cgit v1.2.1