diff options
author | tim@threads.polyesthetic.msg <> | 2000-11-06 12:23:19 -0500 |
---|---|---|
committer | tim@threads.polyesthetic.msg <> | 2000-11-06 12:23:19 -0500 |
commit | 1157c688a83c6402ed03e2890196d8402be8e52d (patch) | |
tree | 6adb6499e148792b64f8bcf0177271789a3e4bfb /include | |
parent | 58b37627aa21785e10fb7d365ba29e2657f9fec2 (diff) | |
download | mariadb-git-1157c688a83c6402ed03e2890196d8402be8e52d.tar.gz |
Changes from teg@redhat.com - subtle bugs that only show up under
certain circumstances.
Diffstat (limited to 'include')
-rw-r--r-- | include/global.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/global.h b/include/global.h index 0934f2931fd..006a0173c34 100644 --- a/include/global.h +++ b/include/global.h @@ -682,10 +682,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */ *((T)+4)=(uchar) (((A) >> 32)); } #define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) -#define doubleget(V,M) { *((long *) &V) = *((long*) M); \ - *(((long *) &V)+1) = *(((long*) M)+1); } -#define doublestore(T,V) { *((long *) T) = *((long*) &V); \ - *(((long *) T)+1) = *(((long*) &V)+1); } +typedef union { + double v; + long m[2]; +} doubleget_union; +#define doubleget(V,M) { ((doubleget_union *)&V)->m[0] = *((long*) M); \ + ((doubleget_union *)&V)->m[1] = *(((long*) M)+1); } +#define doublestore(T,V) { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ + *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; } #define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } #define float8get(V,M) doubleget((V),(M)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) |