warning fixes

This commit is contained in:
Hisham Muhammad
2010-02-25 01:43:18 +00:00
parent 5cc8998688
commit 02a30bfecd
35 changed files with 179 additions and 171 deletions

View File

@ -27,6 +27,7 @@ in the source distribution for its full text.
#include <stdbool.h>
#include <sys/utsname.h>
#include <stdarg.h>
#include <math.h>
#include "debug.h"
#include <assert.h>
@ -699,6 +700,7 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
int percent_cpu = (process->utime + process->stime - lasttimes) /
period * 100.0;
process->percent_cpu = MAX(MIN(percent_cpu, processors*100.0), 0.0);
if (isnan(process->percent_cpu)) process->percent_cpu = 0.0;
process->percent_mem = (process->m_resident * PAGE_SIZE_KB) /
(float)(this->totalMem) *