summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-06-26 04:54:11 +0400
committerunknown <konstantin@mysql.com>2004-06-26 04:54:11 +0400
commitacb0906d1f04baf1cd963e92cb15d74088d0193a (patch)
tree52ea4fd66ebcc1372e21c18686b7c6e710820b07 /include/my_global.h
parente4114faae10bfae45ddf634cf53557d4a4ca7a09 (diff)
downloadmariadb-git-acb0906d1f04baf1cd963e92cb15d74088d0193a.tar.gz
Fix for compilation failure on high-byte-first platforms.
include/my_global.h: Fix for libmysql compilation failure on high-byte-first systems: - add typecasting to char * in shortstore, longstore, doublestore macros libmysql/libmysql.c: - suppress possible warnings
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 70b5b1af819..e8a00ddaa3a 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1076,13 +1076,14 @@ do { doubleget_union _tmp; \
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\
- *((T)+1)=(char) ((byte *) &V)[5];\
- *((T)+2)=(char) ((byte *) &V)[6];\
- *((T)+3)=(char) ((byte *) &V)[7];\
- *((T)+4)=(char) ((byte *) &V)[0];\
- *((T)+5)=(char) ((byte *) &V)[1];\
- *((T)+6)=(char) ((byte *) &V)[2];\
- *((T)+7)=(char) ((byte *) &V)[3]; } while(0)
+ *(((char*)T)+1)=(char) ((byte *) &V)[5];\
+ *(((char*)T)+2)=(char) ((byte *) &V)[6];\
+ *(((char*)T)+3)=(char) ((byte *) &V)[7];\
+ *(((char*)T)+4)=(char) ((byte *) &V)[0];\
+ *(((char*)T)+5)=(char) ((byte *) &V)[1];\
+ *(((char*)T)+6)=(char) ((byte *) &V)[2];\
+ *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\
+ while(0)
#define doubleget(V,M) do { double def_temp;\
((byte*) &def_temp)[0]=(M)[4];\
((byte*) &def_temp)[1]=(M)[5];\
@@ -1134,12 +1135,12 @@ do { doubleget_union _tmp; \
((byte*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0)
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
- *(T+1)=(char)(def_temp); \
- *(T+0)=(char)(def_temp >> 8); } while(0)
-#define longstore(T,A) do { *((T)+3)=((A));\
- *((T)+2)=(((A) >> 8));\
- *((T)+1)=(((A) >> 16));\
- *((T)+0)=(((A) >> 24)); } while(0)
+ *(((char*)T)+1)=(char)(def_temp); \
+ *(((char*)T)+0)=(char)(def_temp >> 8); } while(0)
+#define longstore(T,A) do { *(((char*)T)+3)=((A));\
+ *(((char*)T)+2)=(((A) >> 8));\
+ *(((char*)T)+1)=(((A) >> 16));\
+ *(((char*)T)+0)=(((A) >> 24)); } while(0)
#define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float))
#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))