diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-24 23:28:29 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-24 23:28:29 -0400 |
commit | bd93b2e1d7a06b48d325d9a4eaf1024ee95c16b8 (patch) | |
tree | 3db50548deaf3cbd0e80bf48f8af26d40cea9d32 | |
parent | 71190654bc926fb137e829fb8e2f9efa1e4344ab (diff) |
Initialize variables, silence warnings.
-rw-r--r-- | darwin/DarwinProcessList.c | 1 | ||||
-rw-r--r-- | darwin/Platform.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index d45ac09c..47904beb 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -16,6 +16,7 @@ in the source distribution for its full text. #include <libproc.h> #include <sys/mman.h> #include <utmpx.h> +#include <err.h> /*{ #include "ProcessList.h" diff --git a/darwin/Platform.c b/darwin/Platform.c index f8108e78..da9cbb75 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -167,7 +167,10 @@ ProcessPidColumn Process_pidColumns[] = { static double Platform_setCPUAverageValues(Meter* mtr) { DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl; int cpus = dpl->super.cpuCount; - double sumNice, sumNormal, sumKernel, sumPercent; + double sumNice = 0.0; + double sumNormal = 0.0; + double sumKernel = 0.0; + double sumPercent = 0.0; for (int i = 1; i <= cpus; i++) { sumPercent += Platform_setCPUValues(mtr, i); sumNice += mtr->values[CPU_METER_NICE]; |