From: Dave Hart Date: Sat, 12 Sep 2009 11:54:54 +0000 (+0000) Subject: [Bug 1292] more VC6 unsigned __int64 workarounds. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27bee89a7cc48bab5a5177dc4db67aecc51b4770;p=thirdparty%2Fntp.git [Bug 1292] more VC6 unsigned __int64 workarounds. bk: 4aab8c0eOdX0d5bJ9gkcXSXXd-ES7w --- diff --git a/ChangeLog b/ChangeLog index 59f9fee9fd..63626a85cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 1292] more VC6 unsigned __int64 workarounds. (4.2.5p210) 2009/09/06 Released by Harlan Stenn * [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for Windows and remove unnecessary reference to applink.c for Windows diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index ab029b4e99..200234a773 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -211,9 +211,16 @@ do { \ * Helpers for converting between "hectonanoseconds" and the * performance counter scale from which interpolated time is * derived. + * + * Once support for VC6 is dropped, the cast of PerfCtrFreq to + * LONGLONG can come out of PERF2HNS(). It avoids the VC6 error + * message: + * + * conversion from unsigned __int64 to double not implemented, use + * signed __int64 */ #define HNS2PERF(hns) ((hns) * PerfCtrFreq / LL_HNS) -#define PERF2HNS(ctr) ((ctr) * LL_HNS / PerfCtrFreq) +#define PERF2HNS(ctr) ((ctr) * LL_HNS / (LONGLONG)PerfCtrFreq) #if defined(_MSC_VER) && _MSC_VER >= 1400 /* VS 2005 */ @@ -1145,7 +1152,7 @@ ntp_timestamp_from_counter( Now.ll < -60 * (LONGLONG) HECTONANOSECONDS) { DPRINTF(1, ("ntp_timestamp_from_counter interpolated " "time %.6fs from current\n", - Now.ll / (double) HECTONANOSECONDS)); + Now.ll / (double)LL_HNS)); DPRINTF(1, ("interpol time %llx from %llx\n", InterpTimestamp, Counterstamp)); @@ -1163,7 +1170,7 @@ ntp_timestamp_from_counter( Now.ll < -60 * (LONGLONG) HECTONANOSECONDS) { DPRINTF(1, ("ntp_timestamp_from_counter serial driver system " "time %.6fs from current\n", - Now.ll / (double) HECTONANOSECONDS)); + Now.ll / (double)LL_HNS)); exit(-1); } #endif @@ -1174,7 +1181,7 @@ ntp_timestamp_from_counter( InterpTimestamp -= FILETIME_1970; result->l_ui = JAN_1970 + (u_int32)(InterpTimestamp / HECTONANOSECONDS); result->l_uf = (u_int32)((InterpTimestamp % HECTONANOSECONDS) * - (FRAC / HECTONANOSECONDS)); + (FRAC / LL_HNS)); } #endif /* HAVE_PPSAPI */