From: Vsevolod Stakhov Date: Sun, 23 Oct 2016 10:11:12 +0000 (+0100) Subject: [Fix] Fix float usage in util:get_time X-Git-Tag: 1.4.0~209 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=124cd1a8573e0d8ea37a9d2239295bc347422579;p=rspamd.git [Fix] Fix float usage in util:get_time Issue: #1065 Reported by: @AlexeySa --- diff --git a/src/libutil/util.h b/src/libutil/util.h index 447e72324..8bee11b5f 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -203,7 +203,7 @@ void g_ptr_array_insert (GPtrArray *array, gint index_, gpointer data); ((dbl) - (int)(dbl)) * 1e9; \ } while (0) #define tv_to_msec(tv) ((tv)->tv_sec * 1000LLU + (tv)->tv_usec / 1000LLU) -#define tv_to_double(tv) ((tv)->tv_sec + (tv)->tv_usec / 1e6f) +#define tv_to_double(tv) ((double)(tv)->tv_sec + (tv)->tv_usec / 1.0e6) #define ts_to_usec(ts) ((ts)->tv_sec * 1000000LLU + \ (ts)->tv_nsec / 1000LLU)