From a2ef3a5bc84dcbb048c782e36346cbbf4bf238ed Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 30 Apr 2020 12:37:17 +0100 Subject: [PATCH] Added casts to 'etl::smallest_int_for_value' --- include/etl/smallest.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/etl/smallest.h b/include/etl/smallest.h index 87a59af0..92f34a80 100644 --- a/include/etl/smallest.h +++ b/include/etl/smallest.h @@ -342,9 +342,9 @@ namespace etl private: // Determines the index of the best signed type for the required value. - static const int TYPE_INDEX = (((VALUE > INT_LEAST8_MAX) || (VALUE < INT_LEAST8_MIN)) ? 1 : 0) + - (((VALUE > INT16_MAX) || (VALUE < INT16_MIN)) ? 1 : 0) + - (((VALUE > INT32_MAX) || (VALUE < INT32_MIN)) ? 1 : 0); + static const int TYPE_INDEX = (((VALUE > intmax_t(INT_LEAST8_MAX)) || (VALUE < intmax_t(INT_LEAST8_MIN))) ? 1 : 0) + + (((VALUE > intmax_t(INT16_MAX)) || (VALUE < intmax_t(INT16_MIN))) ? 1 : 0) + + (((VALUE > intmax_t(INT32_MAX)) || (VALUE < intmax_t(INT32_MIN))) ? 1 : 0); public: