]> granicus.if.org Git - check/commitdiff
Disable warning from implicit cast of double to time_t or long
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 17:58:10 +0000 (17:58 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 17:58:10 +0000 (17:58 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@792 64e312b2-a51f-0410-8e61-82d0ca0eb02a

src/check.c

index 0d84003390ca35a1b8a8a47f0f4c7e26df799c3a..bdbd2b3607610ee580c67879ce0732db6b7045fc 100644 (file)
@@ -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);
   }
 }