Hal Murray via devel writes: > commit 194cbd22565ae49dde0d70b9d47033e50edb097d > Author: Gary E. Miller <[email protected]> > Date: Thu Apr 6 19:09:04 2017 -0700 > Fix 120 warnings, and round on conversion from double to l_fp. > > - return (l_fp)((int64_t)ldexp(d, 32)); > + return (l_fp)(llround(ldexp(d, 32)));
It's not supposed to do any rounding, the original function that I simplified to the casted ldexp expression was truncating to the integer seconds. The old code also worked around some problem with the cast not working correctly for negative numbers, which can only happen for _very_ old compilers implementing their own FP (instead of using the FPU) and is something C99 mandates to work anyway. The bad function cast warning is absolutely stupid and should be switched off, since it warns about something that is intended to happen (and a bit difficult to get at otherwise, since it's part of the language standard, so no library re-implements it). 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 _______________________________________________ devel mailing list [email protected] http://lists.ntpsec.org/mailman/listinfo/devel
