lfpinit() signed or unsigned?

Achim Gratz Stromeko at nexgo.de
Sat Mar 11 08:45:11 UTC 2017


Hal Murray writes:
> How about something like l_fp_time (unsigned) and l_fp_delta or l_fp_offset 
> (signed)?

The l_fp timestamps must be unsigned since they are just counting
seconds from the beginning of the epoch.  That means that there's an
assumption somewhere in NTP that differences between those timestamps,
which are necessarily signed unless you want to carry the direction of
the difference as a separate datum, are limited to less or equal than
half the range of that type.  If you compute that difference in modulo
arithmetic, then timestamp differences between two adjacent epochs are
still valid as long as the true time difference is less than half an
epoch.  In other words, you don't have to explicitly check for the epoch
of either timestamp if you assume that these are less than 68 years
apart.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds



More information about the devel mailing list