]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Drop duplicated int64_to_timeval()
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Jun 2013 11:11:53 +0000 (13:11 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Jun 2013 11:11:53 +0000 (13:11 +0200)
util.c

diff --git a/util.c b/util.c
index 0861d739b50af8023e7fdfd1ca9d8b53563029a6..3ae06d808a74463c0f493082276f167cb9bdbc86 100644 (file)
--- a/util.c
+++ b/util.c
@@ -210,19 +210,6 @@ UTI_TimevalToString(struct timeval *tv)
   return result;
 }
 
-/* ================================================== */
-#define JAN_1970 0x83aa7e80UL
-
-inline static void
-int64_to_timeval(NTP_int64 *src,
-                 struct timeval *dest)
-{
-  dest->tv_sec = ntohl(src->hi) - JAN_1970;
-  
-  /* Until I invent a slick way to do this, just do it the obvious way */
-  dest->tv_usec = (int)(0.5 + (double)(ntohl(src->lo)) / 4294.967296);
-}
-
 /* ================================================== */
 /* Convert an NTP timestamp into a temporary string, largely
    for diagnostic display */
@@ -231,7 +218,7 @@ char *
 UTI_TimestampToString(NTP_int64 *ts)
 {
   struct timeval tv;
-  int64_to_timeval(ts, &tv);
+  UTI_Int64ToTimeval(ts, &tv);
   return UTI_TimevalToString(&tv);
 }