summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-05-26 16:32:05 +0000
committerHisham Muhammad <hisham@gobolinux.org>2011-05-26 16:32:05 +0000
commit9599e5650edac773195c2c2036393aabf2f7190e (patch)
tree28042078cab18a0e018523548aede9d1580fbc5d /ProcessList.c
parent9b3514062f60000a9505c56899650f567c5b8f4e (diff)
larger numbers
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ProcessList.c b/ProcessList.c
index 278cfea3..aa5f8678 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -544,7 +544,7 @@ static bool ProcessList_readCmdlineFile(Process* process, const char* dirname, c
}
-static bool ProcessList_processEntries(ProcessList* this, const char* dirname, Process* parent, float period) {
+static bool ProcessList_processEntries(ProcessList* this, const char* dirname, Process* parent, double period) {
DIR* dir;
struct dirent* entry;
@@ -597,13 +597,13 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
process->show = ! ((hideKernelThreads && Process_isKernelThread(process)) || (hideUserlandThreads && Process_isUserlandThread(process)));
char command[MAX_NAME+1];
- int lasttimes = (process->utime + process->stime);
+ unsigned long long int lasttimes = (process->utime + process->stime);
if (! ProcessList_readStatFile(process, dirname, name, command))
goto errorReadingProcess;
int percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0;
process->percent_cpu = MAX(MIN(percent_cpu, cpus*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) * 100.0;
+ process->percent_mem = (process->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0;
if(!existingProcess) {
@@ -774,7 +774,7 @@ void ProcessList_scan(ProcessList* this) {
cpuData->guestTime = guest;
cpuData->totalTime = totaltime;
}
- float period = (float)this->cpus[0].totalPeriod / cpus; fclose(file);
+ double period = (double)this->cpus[0].totalPeriod / cpus; fclose(file);
// mark all process as "dirty"
for (int i = 0; i < Vector_size(this->processes); i++) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy