From 5157755a3acb693e9e213ecf065f7162257afbea Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 14 Nov 2023 14:57:14 -0500 Subject: always include sentinel value --- src/_assert.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/_assert.h b/src/_assert.h index edf3add0..5e472e89 100644 --- a/src/_assert.h +++ b/src/_assert.h @@ -28,18 +28,12 @@ } while (0) #define ASSERT_REPRESENTABLE(_n, _min, _max, _type, _sentinel) do { \ - if (_sentinel && (_n != _sentinel && (_n < _min || _n > _max))) { \ + if ((_n) != _sentinel && ((_n) < _min || (_n) > _max)) { \ struct __constraint_info _ci = {0}; \ _ci.func = __func__; \ __stdlib.constraint_handler("Undefined behavior: " \ "Parameter " #_n " must be representable as a " #_type \ " or be equal to " #_sentinel, &_ci, ERANGE); \ - } else if (_n < _min || _n > _max) { \ - struct __constraint_info _ci = {0}; \ - _ci.func = __func__; \ - __stdlib.constraint_handler("Undefined behavior: " \ - "Parameter " #_n " must be representable as a " #_type, \ - &_ci, ERANGE); \ } \ } while (0) #else -- cgit v1.2.1