diff options
author | DJ Delorie <dj@redhat.com> | 2009-03-30 03:01:38 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2009-03-30 03:01:38 +0000 |
commit | 87d32bb7b0faf1de5a5f8d2b9a7b6a398a431cc8 (patch) | |
tree | a97f2068fc779dc5d0d0c844502a1883b42759a8 /libdecnumber/decDouble.h | |
parent | f2be950300e01d47ae4f41fb7481c26319d33d81 (diff) | |
download | gdb-87d32bb7b0faf1de5a5f8d2b9a7b6a398a431cc8.zip gdb-87d32bb7b0faf1de5a5f8d2b9a7b6a398a431cc8.tar.gz gdb-87d32bb7b0faf1de5a5f8d2b9a7b6a398a431cc8.tar.bz2 |
merge from gcc
Diffstat (limited to 'libdecnumber/decDouble.h')
-rw-r--r-- | libdecnumber/decDouble.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/libdecnumber/decDouble.h b/libdecnumber/decDouble.h index 53fcf40..aa8d77d 100644 --- a/libdecnumber/decDouble.h +++ b/libdecnumber/decDouble.h @@ -31,24 +31,22 @@ /* ------------------------------------------------------------------ */ /* decDouble.h -- Decimal 64-bit format module header */ /* ------------------------------------------------------------------ */ -/* Please see decFloats.h for an overview and documentation details. */ -/* ------------------------------------------------------------------ */ #if !defined(DECDOUBLE) #define DECDOUBLE - #define DECDOUBLENAME "decimalDouble" /* Short name */ + #define DECDOUBLENAME "decimalDouble" /* Short name */ #define DECDOUBLETITLE "Decimal 64-bit datum" /* Verbose name */ #define DECDOUBLEAUTHOR "Mike Cowlishaw" /* Who to blame */ /* parameters for decDoubles */ #define DECDOUBLE_Bytes 8 /* length */ #define DECDOUBLE_Pmax 16 /* maximum precision (digits) */ - #define DECDOUBLE_Emin -383 /* minimum adjusted exponent */ - #define DECDOUBLE_Emax 384 /* maximum adjusted exponent */ + #define DECDOUBLE_Emin -383 /* minimum adjusted exponent */ + #define DECDOUBLE_Emax 384 /* maximum adjusted exponent */ #define DECDOUBLE_EmaxD 3 /* maximum exponent digits */ - #define DECDOUBLE_Bias 398 /* bias for the exponent */ - #define DECDOUBLE_String 25 /* maximum string length, +1 */ + #define DECDOUBLE_Bias 398 /* bias for the exponent */ + #define DECDOUBLE_String 25 /* maximum string length, +1 */ #define DECDOUBLE_EconL 8 /* exponent continuation length */ #define DECDOUBLE_Declets 5 /* count of declets */ /* highest biased exponent (Elimit-1) */ @@ -58,11 +56,14 @@ #include "decContext.h" #include "decQuad.h" - /* The decDouble decimal 64-bit type, accessible by various types */ + /* The decDouble decimal 64-bit type, accessible by all sizes */ typedef union { - uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */ + uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */ uint16_t shorts[DECDOUBLE_Bytes/2]; - uint32_t words[DECDOUBLE_Bytes/4]; + uint32_t words[DECDOUBLE_Bytes/4]; + #if DECUSE64 + uint64_t longs[DECDOUBLE_Bytes/8]; + #endif } decDouble; /* ---------------------------------------------------------------- */ @@ -75,6 +76,7 @@ extern decDouble * decDoubleFromBCD(decDouble *, int32_t, const uint8_t *, int32_t); extern decDouble * decDoubleFromInt32(decDouble *, int32_t); extern decDouble * decDoubleFromPacked(decDouble *, int32_t, const uint8_t *); + extern decDouble * decDoubleFromPackedChecked(decDouble *, int32_t, const uint8_t *); extern decDouble * decDoubleFromString(decDouble *, const char *, decContext *); extern decDouble * decDoubleFromUInt32(decDouble *, uint32_t); extern decDouble * decDoubleFromWider(decDouble *, const decQuad *, decContext *); @@ -160,7 +162,8 @@ /* decNumber conversions; these are implemented as macros so as not */ /* to force a dependency on decimal64 and decNumber in decDouble. */ + /* decDoubleFromNumber returns a decimal64 * to avoid warnings. */ #define decDoubleToNumber(dq, dn) decimal64ToNumber((decimal64 *)(dq), dn) - #define decDoubleFromNumber(dq, dn, set) (decDouble *)decimal64FromNumber((decimal64 *)(dq), dn, set) + #define decDoubleFromNumber(dq, dn, set) decimal64FromNumber((decimal64 *)(dq), dn, set) #endif |