fix compile on windows
This commit is contained in:
parent
6e4013b190
commit
a8994b4239
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue