Skip to content

Commit 642b400

Browse files
authored
Merge pull request #76 from douzzer/20251020-fix-MIN_SINT_OF
20251020-fix-MIN_SINT_OF
2 parents fe9d1c9 + 48e2c86 commit 642b400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wolfsentry/wolfsentry_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
/*!< \brief Evaluates to the largest representable `unsigned int` in a word the size of `x`. @hideinitializer */
104104
#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))))
105105
/*!< \brief Evaluates to the largest representable `signed int` in a word the size of `x`. @hideinitializer */
106-
#define MIN_SINT_OF(x) ((int64_t)((uint64_t)1 << ((sizeof(x) * (uint64_t)BITS_PER_BYTE) - (uint64_t)1)))
106+
#define MIN_SINT_OF(x) (-MAX_SINT_OF(x) - 1)
107107
/*!< \brief Evaluates to the largest negative representable `signed int` in a word the size of `x`. @hideinitializer */
108108

109109
#define WOLFSENTRY_SET_BITS(enumint, bits) ((enumint) |= (bits))

0 commit comments

Comments
 (0)