]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1292] more VC6 unsigned __int64 workarounds.
authorDave Hart <hart@ntp.org>
Sat, 12 Sep 2009 11:54:54 +0000 (11:54 +0000)
committerDave Hart <hart@ntp.org>
Sat, 12 Sep 2009 11:54:54 +0000 (11:54 +0000)
bk: 4aab8c0eOdX0d5bJ9gkcXSXXd-ES7w

ChangeLog
ports/winnt/ntpd/nt_clockstuff.c

index 59f9fee9fdf1899c56cc3cf4358e5f3527744289..63626a85cf3e5e56aa30dd6aaac0916144e94f94 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 1294] Use OPENSSL_INC and OPENSSL_LIB macros for Windows
   and remove unnecessary reference to applink.c for Windows
index ab029b4e99fcdb976c71ef0c613d014d8db2f4c1..200234a773e4e02253331da5462eeb980f31c2aa 100644 (file)
@@ -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 */