lfpinit() signed or unsigned?

Hal Murray hmurray at megapathdsl.net
Wed Mar 22 10:31:39 UTC 2017


esr at thyrsus.com said:
> The calendar code uses "cycle" in this sense when emphasizing the
> modular-arithmetic aspect of the computation.  "NTP era" is used in the
> sense of some particlar cycle (usually numbered) in the documentation, also
> as a synonym for "cycle". 

There should be few uses of l_fp so we shouldn't have to worry about the 
words.

The main use should be in a packet.  The server side is just filling in 2 
slots: arrival and transmission times.  The seconds part is truncated from 
POSIX time before or after adding in the offset correction.  The fractional 
time is converted from POSIX nanoseconds.  (and there is some fuzzing)

The client side does a subtract to get the offset.  That should be signed.  
We can probably convert to floating point if that will clean things up.

There should be no place that converts a l_fp to POSIX time and no need for a 
pivot anywhere in the code.  We are assuming that the environment will switch 
to 64 bit time_t before 2038 and that the system initialization gets the time 
close-enough before ntpd is started.  Close-enough is within 31 bits of 
seconds.  At worst, we'll need a simple shell script.

-----

Gary noticed that the stats file stuff is using l_fp for time stamps.  I'll 
fix that soon.

I think the calendar code will get significantly smaller when I delete the 
stuff that is no longer used.



-- 
These are my opinions.  I hate spam.





More information about the devel mailing list