From: Andre Noll Date: Thu, 1 Jan 2015 18:12:25 +0000 (+0000) Subject: time.c: Remove unused d2tv(). X-Git-Tag: v0.5.4~20 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=cb4f8bc9718816110bef77ed1ba124d723c253b5;p=paraslash.git time.c: Remove unused d2tv(). Found by cppcheck. --- diff --git a/para.h b/para.h index e8aa3e84..2138422e 100644 --- a/para.h +++ b/para.h @@ -88,7 +88,6 @@ int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds); int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff); long unsigned tv2ms(const struct timeval *tv); -void d2tv(double x, struct timeval *tv); void tv_add(const struct timeval *a, const struct timeval *b, struct timeval *sum); void tv_scale(const unsigned long mult, const struct timeval *tv, diff --git a/time.c b/time.c index 040053d2..6042c487 100644 --- a/time.c +++ b/time.c @@ -31,18 +31,6 @@ void ms2tv(long unsigned n, struct timeval *tv) tv->tv_usec = (n % 1000) * 1000; } -/** - * Convert a double to a struct timeval. - * - * \param x The value to convert. - * \param tv Result pointer. - */ -void d2tv(double x, struct timeval *tv) -{ - tv->tv_sec = x; - tv->tv_usec = (x - (double)tv->tv_sec) * 1000.0 * 1000.0 + 0.5; -} - /** * Compute the difference of two time values. *