Skip to content

Commit 48e2c86

Browse files
committed
wolfsentry/wolfsentry_util.h: fix definition of MIN_SINT_OF().
1 parent fe9d1c9 commit 48e2c86

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)