[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH] include: Define __SZ_MAX to the same value as __SSZ_MAX
Before this commit, GCC warned that __SZ_MAX was exceeding the maximum object size. Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> --- include/uk/arch/limits.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/include/uk/arch/limits.h b/include/uk/arch/limits.h index 9fa3c69d..c4d4bc22 100644 --- a/include/uk/arch/limits.h +++ b/include/uk/arch/limits.h @@ -47,10 +47,12 @@ #if (defined __C_IS_8) #define __C_MAX (127) +#define __C_MAX_U (127U) #define __C_MIN (-__C_MAX - 1) #define __UC_MAX (255U) #define __UC_MIN (0U) #define __S8_MAX __C_MAX +#define __S8_MAX_U __C_MAX_U #define __S8_MIN __C_MIN #define __U8_MAX __UC_MAX #define __U8_MIN __UC_MIN @@ -61,16 +63,19 @@ #if (defined __S_IS_8) #define __S_MAX (127) +#define __S_MAX_U (127U) #define __S_MIN (-__S_MAX - 1) #define __US_MAX (255U) #define __US_MIN (0U) #undef __S_IS_8 #elif (defined __S_IS_16) #define __S_MAX (32767) +#define __S_MAX_U (32767U) #define __S_MIN (-__S_MAX - 1) #define __US_MAX (65535U) #define __US_MIN (0U) #define __S16_MAX __S_MAX +#define __S16_MAX_U __S_MAX_U #define __S16_MIN __S_MIN #define __U16_MAX __US_MAX #define __U16_MIN __US_MIN @@ -80,11 +85,13 @@ #if (defined __I_IS_16) #define __I_MAX (32767) +#define __I_MAX_U (32767U) #define __I_MIN (-__I_MAX - 1) #define __UI_MAX (65535U) #define __UI_MIN (0U) #ifndef __HAVE_INT16__ #define __S16_MAX __I_MAX +#define __S16_MAX_U __I_MAX_U #define __S16_MIN __I_MIN #define __U16_MAX __UI_MAX #define __U16_MIN __UI_MIN @@ -93,11 +100,13 @@ #undef __I_IS_16 #elif (defined __I_IS_32) #define __I_MAX (2147483647) +#define __I_MAX_U (2147483647U) #define __I_MIN (-__I_MAX - 1) #define __UI_MAX (4294967295U) #define __UI_MIN (0U) #ifndef __HAVE_INT32__ #define __S32_MAX __I_MAX +#define __S32_MAX_U __I_MAX_U #define __S32_MIN __I_MIN #define __U32_MAX __UI_MAX #define __U32_MIN __UI_MIN @@ -106,11 +115,13 @@ #undef __I_IS_32 #elif (defined __I_IS_64) #define __I_MAX (9223372036854775807) +#define __I_MAX_U (9223372036854775807U) #define __I_MIN (-__I_MAX - 1) #define __UI_MAX (18446744073709551615U) #define __UI_MIN (0U) #ifndef __HAVE_INT64__ #define __S64_MAX __I_MAX +#define __S64_MAX_U __I_MAX_U #define __S64_MIN __I_MIN #define __U64_MAX __UI_MAX #define __U64_MIN __UI_MIN @@ -121,11 +132,13 @@ #if (defined __L_IS_32) #define __L_MAX (2147483647L) +#define __L_MAX_U (2147483647UL) #define __L_MIN (-__L_MAX - 1L) #define __UL_MAX (4294967295UL) #define __UL_MIN (0UL) #ifndef __HAVE_INT32__ #define __S32_MAX __L_MAX +#define __S32_MAX_U __L_MAX_U #define __S32_MIN __L_MIN #define __U32_MAX __UL_MAX #define __U32_MIN __UL_MIN @@ -134,11 +147,13 @@ #undef __L_IS_32 #elif (defined __L_IS_64) #define __L_MAX (9223372036854775807L) +#define __L_MAX_U (9223372036854775807UL) #define __L_MIN (-__L_MAX - 1L) #define __UL_MAX (18446744073709551615UL) #define __UL_MIN (0UL) #ifndef __HAVE_INT64__ #define __S64_MAX __L_MAX +#define __S64_MAX_U __L_MAX_U #define __S64_MIN __L_MIN #define __U64_MAX __UL_MAX #define __U64_MIN __UL_MIN @@ -149,11 +164,13 @@ #if (defined __LL_IS_32) #define __LL_MAX (2147483647LL) +#define __LL_MAX_U (2147483647ULL) #define __LL_MIN (-__LL_MAX - 1LL) #define __ULL_MAX (4294967295ULL) #define __ULL_MIN (0ULL) #ifndef __HAVE_INT32__ #define __S32_MAX __LL_MAX +#define __S32_MAX_U __LL_MAX_U #define __S32_MIN __LL_MIN #define __U32_MAX __ULL_MAX #define __U32_MIN __ULL_MIN @@ -162,11 +179,13 @@ #undef __LL_IS_32 #elif (defined __LL_IS_64) #define __LL_MAX (9223372036854775807LL) +#define __LL_MAX_U (9223372036854775807ULL) #define __LL_MIN (-__LL_MAX - 1LL) #define __ULL_MAX (18446744073709551615ULL) #define __ULL_MIN (0ULL) #ifndef __HAVE_INT64__ #define __S64_MAX __LL_MAX +#define __S64_MAX_U __LL_MAX_U #define __S64_MIN __LL_MIN #define __U64_MAX __ULL_MAX #define __U64_MIN __ULL_MIN @@ -178,7 +197,7 @@ #if (defined __PTR_IS_16) #define __PTR_MAX __U16_MAX #define __PTR_MIN __U16_MIN -#define __SZ_MAX __U16_MAX +#define __SZ_MAX __S16_MAX_U #define __SZ_MIN __U16_MIN #define __SSZ_MAX __S16_MAX #define __SSZ_MIN __S16_MIN @@ -188,7 +207,7 @@ #elif (defined __PTR_IS_32) #define __PTR_MAX __U32_MAX #define __PTR_MIN __U32_MIN -#define __SZ_MAX __U32_MAX +#define __SZ_MAX __S32_MAX_U #define __SZ_MIN __U32_MIN #define __SSZ_MAX __S32_MAX #define __SSZ_MIN __S32_MIN @@ -198,7 +217,7 @@ #elif (defined __PTR_IS_64) #define __PTR_MAX __U64_MAX #define __PTR_MIN __U64_MIN -#define __SZ_MAX __U64_MAX +#define __SZ_MAX __S64_MAX_U #define __SZ_MIN __U64_MIN #define __SSZ_MAX __S64_MAX #define __SSZ_MIN __S64_MIN -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |