fix compile on windows

This commit is contained in:
Doug MacEachern 2008-03-13 19:02:11 +00:00
parent 6e4013b190
commit a8994b4239
1 changed files with 5 additions and 5 deletions

View File

@ -612,11 +612,11 @@ SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev,
{ {
double diff_user, diff_sys, diff_nice, diff_idle, diff_wait, diff_total; double diff_user, diff_sys, diff_nice, diff_idle, diff_wait, diff_total;
diff_user = curr->user - prev->user; diff_user = (sigar_int64_t)(curr->user - prev->user);
diff_sys = curr->sys - prev->sys; diff_sys = (sigar_int64_t)(curr->sys - prev->sys);
diff_nice = curr->nice - prev->nice; diff_nice = (sigar_int64_t)(curr->nice - prev->nice);
diff_idle = curr->idle - prev->idle; diff_idle = (sigar_int64_t)(curr->idle - prev->idle);
diff_wait = curr->wait - prev->wait; diff_wait = (sigar_int64_t)(curr->wait - prev->wait);
diff_user = diff_user < 0 ? 0 : diff_user; diff_user = diff_user < 0 ? 0 : diff_user;
diff_sys = diff_sys < 0 ? 0 : diff_sys; diff_sys = diff_sys < 0 ? 0 : diff_sys;