]> sjero.net Git - wget/commitdiff
[svn] Work around VC's inability to cast unsigned __int64 to void.
authorhniksic <devnull@localhost>
Tue, 16 Sep 2003 21:16:59 +0000 (14:16 -0700)
committerhniksic <devnull@localhost>
Tue, 16 Sep 2003 21:16:59 +0000 (14:16 -0700)
src/ChangeLog
src/utils.c

index b6de6c406304e39128deb7259a1d54cf0056ff7f..6ec4e7c3f4894e0b83e88ad8fde126775e9bbeb6 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-16  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * 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  <hniksic@xemacs.org>
 
        * Makefile.in (clean): Also remove the core.<number> files
index 74e4552fd4eeb5c67e58085a3e741a24ea42267f..0f443411f443ab1fd9a19d1771b4a0820ea2e088 100644 (file)
@@ -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
 }