diff options
Diffstat (limited to 'multiload/linux-proc.c')
-rw-r--r-- | multiload/linux-proc.c | 7 |
1 files changed, 2 insertions, 5 deletions
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]; |