Achim Gratz writes: > The better patch is probably to fix either the comments or the inline > functions in timespecops.h that have their logic reversed (apparently > since the beginning) and possibly fix the current uses in systime.c and > add tests that actually test for something else than equality.
I've opted to fix the comments.
>From 6e2f2216a9efd51dcb45b4e32e177136d5e2bacc Mon Sep 17 00:00:00 2001 From: Achim Gratz <strom...@stromeko.de> Date: Sat, 25 Feb 2017 12:46:39 +0100 Subject: [PATCH 1/2] Correct comments about the return value for ternary comparison macros * include/timespecops.h: The sign of the return value is opposite from what the comment says it should be. Fix the comment as the implementation has apparently never changed. --- include/timespecops.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/timespecops.h b/include/timespecops.h index 03848cb..2899ffd 100644 --- a/include/timespecops.h +++ b/include/timespecops.h @@ -213,7 +213,7 @@ abs_tspec( /* * compare previously-normalised a and b - * return 1 / 0 / -1 if a < / == / > b + * return -1 / 0 / 1 if a < / == / > b */ static inline int @@ -234,7 +234,7 @@ cmp_tspec( /* * compare possibly-denormal a and b - * return 1 / 0 / -1 if a < / == / > b + * return -1 / 0 / 1 if a < / == / > b */ static inline int cmp_tspec_denorm( @@ -247,7 +247,7 @@ cmp_tspec_denorm( /* * test previously-normalised a - * return 1 / 0 / -1 if a < / == / > 0 + * return -1 / 0 / 1 if a < / == / > 0 */ static inline int test_tspec( @@ -265,7 +265,7 @@ test_tspec( /* * test possibly-denormal a - * return 1 / 0 / -1 if a < / == / > 0 + * return -1 / 0 / 1 if a < / == / > 0 */ static inline int test_tspec_denorm( -- 2.1.4
Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for KORG EX-800 and Poly-800MkII V0.9: http://Synth.Stromeko.net/Downloads.html#KorgSDada
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel