svn commit: samba r4670 - in branches/SAMBA_4_0/source/lib: .
tridge at samba.org
tridge at samba.org
Tue Jan 11 03:26:26 GMT 2005
Author: tridge
Date: 2005-01-11 03:26:26 +0000 (Tue, 11 Jan 2005)
New Revision: 4670
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4670
Log:
abartlet was worried about floating point precision with my first
version - here is one based purely on 64 bit math
Modified:
branches/SAMBA_4_0/source/lib/time.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/time.c
===================================================================
--- branches/SAMBA_4_0/source/lib/time.c 2005-01-11 03:07:53 UTC (rev 4669)
+++ branches/SAMBA_4_0/source/lib/time.c 2005-01-11 03:26:26 UTC (rev 4670)
@@ -543,6 +543,6 @@
*/
NTTIME timeval_to_nttime(struct timeval *tv)
{
- double t1 = tv->tv_sec + (tv->tv_usec*1.0e-6);
- return (t1 + TIME_FIXUP_CONSTANT) * 1.0e7;
+ return 10*(tv->tv_usec +
+ ((TIME_FIXUP_CONSTANT + (uint64_t)tv->tv_sec) * 1000000));
}
More information about the samba-cvs
mailing list