> From: Bill Stoddard [mailto:stoddard@raleigh.ibm.com]
> Sent: Tuesday, March 28, 2000 12:48 PM
>
> Reviewing aprwinsrc.diffs...
>
> We do not need FileTimeToUnixTime(). The time values in
> file_t should be in
> APR time (use FileTimeToAprTime). Also, your conversion to
> AP_DELTA_EPOCH_IN_100NS is off by a factor of 10 in the
> routines where you
> use it. I will rework the patch the commit it.
>
Please recheck (I simply accepted the existing values as gospel). Simply
put, 100NS saved us from double division and multiplication of 1s time, and
had no harm to the 1ms time. I'd personally like to see both flavors
preserved.
from timetest:
temp = 116444736000000000;
diffs to time.h
#define AP_DELTA_EPOCH_IN_USEC 11644473600000000;
+#define AP_DELTA_EPOCH_IN_100NS 116444736000000000i64;
Factor of 10 would be correct here, 100NS is 10^7 the USEC is 10^6.
Explicit i64 was a reaction to a bug elsewhere, I believe it's unnecessary.
void FileTimeToAprTime(ap_time_t *result, FILETIME *input)
+ *result = AP_DELTA_EPOCH_IN_100NS;
*result /= 10;
 *result = AP_DELTA_EPOCH_IN_USEC;
Note I changed the sequence in which we subtract, so 100NS is the delta of
ms/10.
void AprTimeToFileTime(LPFILETIME pft, ap_time_t t)
 t += AP_DELTA_EPOCH_IN_USEC;
ll = t * 10;
+ t += AP_DELTA_EPOCH_IN_100NS;
Again, changed the sequence in which we increment, so 100NS is the delta
after ms*10.
time_t FileTimeToUnixTime(FILETIME *time)
+ temp = AP_DELTA_EPOCH_IN_100NS;
+ temp /= 10000000;
This is right as well, 100NS increment is 10^7 smaller than 1S.
void UnixTimeToFileTime(LPFILETIME pft, time_t t)
+ ll = t * 10000000;
+ ll += AP_DELTA_EPOCH_IN_100NS;
Same 10^7 here
