From c95d75292b7fb99ded9c9252d9e01511d9a0f0d1 Mon Sep 17 00:00:00 2001 From: hniksic Date: Tue, 16 Sep 2003 14:16:59 -0700 Subject: [PATCH] [svn] Work around VC's inability to cast unsigned __int64 to void. --- src/ChangeLog | 6 ++++++ src/utils.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b6de6c40..6ec4e7c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-09-16 Hrvoje Niksic + + * utils.c (wtimer_sys_diff): Convert the time difference to signed + __int64, then to double. This works around MS VC++ 6 which can't + convert unsigned __int64 to double directly. + 2003-09-16 Hrvoje Niksic * Makefile.in (clean): Also remove the core. files diff --git a/src/utils.c b/src/utils.c index 74e4552f..0f443411 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1648,7 +1648,10 @@ wtimer_sys_diff (wget_sys_time *wst1, wget_sys_time *wst2) #endif #ifdef WINDOWS - return (double)(wst1->QuadPart - wst2->QuadPart) / 10000; + /* VC++ 6 doesn't support direct cast of uint64 to double. To work + around this, we subtract, then convert to signed, then finally to + double. */ + return (double)(signed __int64)(wst1->QuadPart - wst2->QuadPart) / 10000; #endif } -- 2.39.2