summaryrefslogtreecommitdiff
path: root/libdecnumber/decDouble.h
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-27 16:45:40 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-27 16:45:40 +0000
commit67da83cb6a7c3a20581e4a8f424bb89c504e4cd3 (patch)
tree130ea634c2b45eddb3c5bd4abf6babb041bd851a /libdecnumber/decDouble.h
parentdf07a54c3de6c774315ca98463160df1dac5ce60 (diff)
downloadgcc-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/decDouble.h')
-rw-r--r--libdecnumber/decDouble.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdecnumber/decDouble.h b/libdecnumber/decDouble.h
index 32eba395d85..53fcf406bec 100644
--- a/libdecnumber/decDouble.h
+++ b/libdecnumber/decDouble.h
@@ -58,9 +58,11 @@
#include "decContext.h"
#include "decQuad.h"
- /* The decDouble decimal 64-bit type, accessible by bytes */
- typedef struct {
+ /* The decDouble decimal 64-bit type, accessible by various types */
+ typedef union {
uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */
+ uint16_t shorts[DECDOUBLE_Bytes/2];
+ uint32_t words[DECDOUBLE_Bytes/4];
} decDouble;
/* ---------------------------------------------------------------- */