From a8994b4239761a872f4f073e275b22235ca7a52a Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 13 Mar 2008 19:02:11 +0000 Subject: [PATCH] fix compile on windows --- src/sigar_format.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sigar_format.c b/src/sigar_format.c index 8cffa9eb..20c5ffe5 100644 --- a/src/sigar_format.c +++ b/src/sigar_format.c @@ -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; - diff_user = curr->user - prev->user; - diff_sys = curr->sys - prev->sys; - diff_nice = curr->nice - prev->nice; - diff_idle = curr->idle - prev->idle; - diff_wait = curr->wait - prev->wait; + diff_user = (sigar_int64_t)(curr->user - prev->user); + diff_sys = (sigar_int64_t)(curr->sys - prev->sys); + diff_nice = (sigar_int64_t)(curr->nice - prev->nice); + diff_idle = (sigar_int64_t)(curr->idle - prev->idle); + diff_wait = (sigar_int64_t)(curr->wait - prev->wait); diff_user = diff_user < 0 ? 0 : diff_user; diff_sys = diff_sys < 0 ? 0 : diff_sys;