From: brarcher Date: Mon, 23 Sep 2013 17:58:10 +0000 (+0000) Subject: Disable warning from implicit cast of double to time_t or long X-Git-Tag: 0.10.0~422 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01486bf36c509ebcd091d472573086a3e7d12e2a;p=check Disable warning from implicit cast of double to time_t or long git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@792 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/src/check.c b/src/check.c index 0d84003..bdbd2b3 100644 --- a/src/check.c +++ b/src/check.c @@ -122,8 +122,8 @@ TCase *tcase_create (const char *name) } } - tc->timeout.tv_sec = floor(timeout_sec); - tc->timeout.tv_nsec = ((timeout_sec-floor(timeout_sec)) * (double)NANOS_PER_SECONDS); + tc->timeout.tv_sec = (time_t)floor(timeout_sec); + tc->timeout.tv_nsec = (long)((timeout_sec-floor(timeout_sec)) * (double)NANOS_PER_SECONDS); tc->tflst = check_list_create(); tc->unch_sflst = check_list_create(); @@ -224,8 +224,8 @@ void tcase_set_timeout (TCase *tc, double timeout) } } - tc->timeout.tv_sec = floor(timeout); - tc->timeout.tv_nsec = ((timeout-floor(timeout)) * (double)NANOS_PER_SECONDS); + tc->timeout.tv_sec = (time_t)floor(timeout); + tc->timeout.tv_nsec = (long)((timeout-floor(timeout)) * (double)NANOS_PER_SECONDS); } }