time.c: Remove unused d2tv().
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 1 Jan 2015 18:12:25 +0000 (18:12 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 12 Jan 2015 22:29:07 +0000 (23:29 +0100)
Found by cppcheck.

para.h
time.c

diff --git a/para.h b/para.h
index e8aa3e84563fbfadfb71e14ad1e0f6c3056ff320..2138422ec0be54d4d0aab4de91a25154cda138fd 100644 (file)
--- 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 040053d26d34832d59da217aa95bdccd27909437..6042c487f57db31c3741e02a4e0ed600cba87a43 100644 (file)
--- 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.
  *