From 4a45113ea17b87340a29d6e15862f8a11ae51a2d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 1 Jan 2024 15:40:34 -0800 Subject: [PATCH] silence compiler warning from minimum int constant --- src/core/options.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/options.h b/src/core/options.h index 9c5d48171..aff429df5 100644 --- a/src/core/options.h +++ b/src/core/options.h @@ -13,8 +13,9 @@ #define CORE_OPTIONS_H // Integer limits. -#define NNI_MAXINT ((int) 2147483647) -#define NNI_MININT ((int) -2147483648) +#define NNI_MAXINT (2147483647) +// the -1 trick works around a compiler warning on some compilers (MSVC) +#define NNI_MININT (-2147483647 - 1) // We limit the maximum size to 4GB. That's intentional because some of the // underlying protocols cannot cope with anything bigger than 32-bits.