From cb4f8bc9718816110bef77ed1ba124d723c253b5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 1 Jan 2015 18:12:25 +0000 Subject: [PATCH 1/1] time.c: Remove unused d2tv(). Found by cppcheck. --- para.h | 1 - time.c | 12 ------------ 2 files changed, 13 deletions(-) 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. * -- 2.39.2