summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2004-08-19 21:41:10 +0200
committerunknown <ingo@mysql.com>2004-08-19 21:41:10 +0200
commit8acc35e20cc9913e185bd5e748e66284e45dd13d (patch)
tree97c1857ddd488855fa96a48374f4e0824fef5938 /include
parent86255afe4db7fd523295f345aeb7ca0db5670e59 (diff)
downloadmariadb-git-8acc35e20cc9913e185bd5e748e66284e45dd13d.tar.gz
Build bug on 64-Bit platforms.
Removed improper casts. Thanks to Joerg Bruehe for the fix. include/my_global.h: Build bug on 64-Bit platforms. Removed improper casts. Changed to uniform writing style. Appended 'L' to 32-Bit constants which doesn't hurt on 32-Bit, but can be important for some 64-Bit compilers.
Diffstat (limited to 'include')
-rw-r--r--include/my_global.h30
1 files changed, 9 insertions, 21 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 33ae35d2308..f24fc05471e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -641,29 +641,17 @@ extern double my_atof(const char*);
#endif
#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/
-#if SIZEOF_LONG == 4
-#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_MIN32 (~0x7FFFFFFFL)
+#define INT_MAX32 0x7FFFFFFFL
+#define UINT_MAX32 0xFFFFFFFFL
+#define INT_MIN24 (~0x007FFFFF)
+#define INT_MAX24 0x007FFFFF
+#define UINT_MAX24 0x00FFFFFF
+#define INT_MIN16 (~0x7FFF)
#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 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
+#define INT_MIN8 (~0x7F)
+#define INT_MAX8 0x7F
/* From limits.h instead */
#ifndef DBL_MIN