[Git][cmucl/cmucl][master] 2 commits: Fix #479: Clean up macros in irrat.c
Raymond Toy pushed to branch master at cmucl / cmucl Commits: a225bbb5 by Raymond Toy at 2026-02-28T09:36:55-08:00 Fix #479: Clean up macros in irrat.c - - - - - 1a961701 by Raymond Toy at 2026-02-28T09:36:55-08:00 Merge branch 'issue-479-clean-up-irrat-signal-macros' into 'master' Fix #479: Clean up macros in irrat.c Closes #479 See merge request cmucl/cmucl!359 - - - - - 1 changed file: - src/lisp/irrat.c Changes: ===================================== src/lisp/irrat.c ===================================== @@ -62,20 +62,26 @@ extern void cr_sincosf(float, float *, float *); */ #define MAYBE_SIGNAL_INVALID(test, val) \ - if ((test)) { \ - return fdlibm_setexception(val, FDLIBM_INVALID); \ - } + do { \ + if ((test)) { \ + return fdlibm_setexception(val, FDLIBM_INVALID); \ + } \ + } while (0) + #define MAYBE_SIGNAL_OVERFLOW(x) \ - if (isinf(x)) { \ - return fdlibm_setexception(x, FDLIBM_OVERFLOW); \ - } + do { \ + if (isinf(x)) { \ + return fdlibm_setexception(x, FDLIBM_OVERFLOW); \ + } \ + } while (0) + double lisp_sin(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_INVALID(isinf(x), x) + MAYBE_SIGNAL_INVALID(isinf(x), x); return cr_sin(x); #else @@ -87,7 +93,7 @@ double lisp_cos(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_INVALID(isinf(x), x) + MAYBE_SIGNAL_INVALID(isinf(x), x); return cr_cos(x); #else @@ -99,7 +105,7 @@ double lisp_tan(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_INVALID(isinf(x), x) + MAYBE_SIGNAL_INVALID(isinf(x), x); return cr_tan(x); #else @@ -151,7 +157,7 @@ double lisp_sinh(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_OVERFLOW(x) + MAYBE_SIGNAL_OVERFLOW(x); return cr_sinh(x); #else @@ -183,7 +189,7 @@ double lisp_asinh(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_OVERFLOW(x) + MAYBE_SIGNAL_OVERFLOW(x); return cr_asinh(x); #else @@ -195,9 +201,9 @@ double lisp_acosh(double x) { #ifdef FEATURE_CORE_MATH - MAYBE_SIGNAL_INVALID(x < 1, x) + MAYBE_SIGNAL_INVALID(x < 1, x); - MAYBE_SIGNAL_OVERFLOW(x) + MAYBE_SIGNAL_OVERFLOW(x); return cr_acosh(x); #else View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/8034ae1f395b02974a33e8a... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/8034ae1f395b02974a33e8a... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)