diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-27 16:45:40 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-27 16:45:40 +0000 |
commit | 67da83cb6a7c3a20581e4a8f424bb89c504e4cd3 (patch) | |
tree | 130ea634c2b45eddb3c5bd4abf6babb041bd851a /libdecnumber/decBasic.c | |
parent | df07a54c3de6c774315ca98463160df1dac5ce60 (diff) | |
download | gcc-67da83cb6a7c3a20581e4a8f424bb89c504e4cd3.tar.gz |
PR other/37897
* decDouble.h (decDouble): Replace struct with union accessible
by more types.
* decSingle.h (decSingle): Ditto.
* decQuad.h (decQuad): Ditto.
* decNumberLocal.h (DFWORD, DFBYTE, DFWWORD): access decFloat via
new members.
* decBasic.c (decFloatCompareTotal): Avoid type-pun violation.
(decNumberCompare): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libdecnumber/decBasic.c')
-rw-r--r-- | libdecnumber/decBasic.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libdecnumber/decBasic.c b/libdecnumber/decBasic.c index 9ce277d2c30..fddba979053 100644 --- a/libdecnumber/decBasic.c +++ b/libdecnumber/decBasic.c @@ -1660,8 +1660,10 @@ decFloat * decFloatCompareTotal(decFloat *result, /* decode the coefficients */ /* (shift both right two if Quad to make a multiple of four) */ #if QUAD - USHORTAT(bufl)=0; - USHORTAT(bufr)=0; + ub = bufl; /* avoid type-pun violation */ + USHORTAT(ub)=0; + uc = bufr; /* avoid type-pun violation */ + USHORTAT(uc)=0; #endif GETCOEFF(dfl, bufl+QUAD*2); /* decode from decFloat */ GETCOEFF(dfr, bufr+QUAD*2); /* .. */ @@ -3542,8 +3544,10 @@ static Int decNumCompare(const decFloat *dfl, const decFloat *dfr, Flag tot) { /* decode the coefficients */ /* (shift both right two if Quad to make a multiple of four) */ #if QUAD - UINTAT(bufl)=0; - UINTAT(bufr)=0; + ub=bufl; /* avoid type-pun violation */ + UINTAT(ub)=0; + uc=bufr; /* avoid type-pun violation */ + UINTAT(uc)=0; #endif GETCOEFF(dfl, bufl+QUAD*2); /* decode from decFloat */ GETCOEFF(dfr, bufr+QUAD*2); /* .. */ |