lfpinit() signed or unsigned?
Gary E. Miller
gem at rellim.com
Thu Mar 9 19:12:08 UTC 2017
Yo Hal!
On Wed, 08 Mar 2017 20:38:33 -0800
Hal Murray <hmurray at megapathdsl.net> wrote:
> gem at rellim.com said:
> > Does lfpinit() need to return a signed? Or should the parameters to
> > lfpinit() annd be unsigned? I'm guessing the later, but I'm new to
> > that part of the code...
>
> I think both parameters should be unsigned.
Good, we agree, I'll move forward on that.
> If you want a negative answer, you need to think about it. What does
> lfpinit(-3,3) mean? I think that will be different from -lfpinit(3,3)
It gets worse. Looks like l_fp needs to be int64_t, not uint64_t.
Sometimes l_fp's are subtracted to get an offset.
And weird things happen in lfp_intv_to_tspec() to guess if l_fp is
unsigned or signed...
Everything still fits. At least until 2038. 7FFFFFFFu is 2147483647
which as a time_t is "Mon Jan 18 19:14:07 PST 2038".
Otherwise -Wsign-conversion does not complain about a lot. My goal
is to get those warnings all fixed.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem at rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170309/58e651c6/attachment.bin>
More information about the devel
mailing list