From 48e2c860bf3732b574a1e7ae3c2cb1779819eca0 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 20 Oct 2025 23:08:00 -0500 Subject: [PATCH] wolfsentry/wolfsentry_util.h: fix definition of MIN_SINT_OF(). --- wolfsentry/wolfsentry_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfsentry/wolfsentry_util.h b/wolfsentry/wolfsentry_util.h index ea9c9e9..7c0b703 100644 --- a/wolfsentry/wolfsentry_util.h +++ b/wolfsentry/wolfsentry_util.h @@ -103,7 +103,7 @@ /*!< \brief Evaluates to the largest representable `unsigned int` in a word the size of `x`. @hideinitializer */ #define MAX_SINT_OF(x) ((int64_t)((((uint64_t)1 << ((sizeof(x) * (uint64_t)BITS_PER_BYTE) - (uint64_t)2)) - (uint64_t)1) | ((uint64_t)1 << ((sizeof(x) * (uint64_t)BITS_PER_BYTE) - (uint64_t)2)))) /*!< \brief Evaluates to the largest representable `signed int` in a word the size of `x`. @hideinitializer */ -#define MIN_SINT_OF(x) ((int64_t)((uint64_t)1 << ((sizeof(x) * (uint64_t)BITS_PER_BYTE) - (uint64_t)1))) +#define MIN_SINT_OF(x) (-MAX_SINT_OF(x) - 1) /*!< \brief Evaluates to the largest negative representable `signed int` in a word the size of `x`. @hideinitializer */ #define WOLFSENTRY_SET_BITS(enumint, bits) ((enumint) |= (bits))