Initialize variables, silence warnings.

This commit is contained in:
Hisham Muhammad 2015-10-24 23:28:29 -04:00
parent 71190654bc
commit bd93b2e1d7
2 changed files with 5 additions and 1 deletions

View File

@ -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"

View File

@ -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];