From ab64eb64af00da22dad43bb4ea4f0d2dfe51438a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Aug 2004 23:43:41 +0200 Subject: Bug #4797 - 32 bit and 64 bit builds behave differently on int32 overflow include/my_global.h: uint_max constants moved from sql_analyse.cc sql/sql_analyse.cc: cleanup --- include/my_global.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/my_global.h b/include/my_global.h index 284cfdc1f97..33ae35d2308 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -642,21 +642,27 @@ extern double my_atof(const char*); #endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/ #if SIZEOF_LONG == 4 -#define INT_MIN32 (long) 0x80000000L -#define INT_MAX32 (long) 0x7FFFFFFFL -#define INT_MIN24 ((long) 0xff800000L) -#define INT_MAX24 0x007fffffL -#define INT_MIN16 ((short int) 0x8000) -#define INT_MAX16 0x7FFF -#define INT_MIN8 ((char) 0x80) -#define INT_MAX8 ((char) 0x7F) +#define INT_MIN32 ((long) 0x80000000L) +#define INT_MAX32 ((long) 0x7FFFFFFFL) +#define UINT_MAX32 ((long) 0xFFFFFFFFL) +#define INT_MIN24 ((long) 0xFF800000L) +#define INT_MAX24 0x007FFFFFL +#define UINT_MAX24 0x00FFFFFFL +#define INT_MIN16 ((short int) 0x8000) +#define INT_MAX16 0x7FFF +#define UINT_MAX16 0xFFFF +#define INT_MIN8 ((char) 0x80) +#define INT_MAX8 ((char) 0x7F) #else /* Probably Alpha */ #define INT_MIN32 ((long) (int) 0x80000000) #define INT_MAX32 ((long) (int) 0x7FFFFFFF) -#define INT_MIN24 ((long) (int) 0xff800000) -#define INT_MAX24 ((long) (int) 0x007fffff) -#define INT_MIN16 ((short int) 0xffff8000) +#define UINT_MAX32 ((long) (int) 0xFFFFFFFF) +#define INT_MIN24 ((long) (int) 0xFF800000) +#define INT_MAX24 ((long) (int) 0x007FFFFF) +#define UINT_MAX24 ((long) (int) 0x00FFFFFF) +#define INT_MIN16 ((short int) 0xFFFF8000) #define INT_MAX16 ((short int) 0x00007FFF) +#define UINT_MAX16 ((short int) 0x0000FFFF) #endif /* From limits.h instead */ -- cgit v1.2.1