From b5965dbded30dcd3e6cae0368b31c3341e00d32d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 May 2003 18:44:37 +0300 Subject: [PATCH] Fixed compiler optimization problem with doubleget() (Casused problems in GIS functions in 4.1) include/global.h: Fixed compiler optimization problem with doubleget() --- include/global.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/global.h b/include/global.h index 1737c60db30..94b0f5bab03 100644 --- a/include/global.h +++ b/include/global.h @@ -795,8 +795,11 @@ 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 doubleget(V,M) \ +{ doubleget_union _tmp; \ + _tmp.m[0] = *((long*)(M)); \ + _tmp.m[1] = *(((long*) (M))+1); \ + (V) = _tmp.v; } #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)); }