From: Miroslav Lichvar Date: Wed, 5 Jun 2013 11:11:53 +0000 (+0200) Subject: Drop duplicated int64_to_timeval() X-Git-Tag: 1.28-pre1~45 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0074135097940aea25947f8a273a20aa8a4a6f36;p=thirdparty%2Fchrony.git Drop duplicated int64_to_timeval() --- diff --git a/util.c b/util.c index 0861d739..3ae06d80 100644 --- 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); }