summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/math.hxx
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
commitac27218d0d423c99fed81f7726ef0bb10d67c14e (patch)
treea8046e11a6fad9af2487ec0c4c26969be1316f25 /sal/inc/rtl/math.hxx
parent98ff20e30873c73ca8ba3995fd0c959a1b28fc78 (diff)
parent6e8628fb7374b7d19e15f03e63f8ad221ca25f1e (diff)
rebase to DEV300_m69
Diffstat (limited to 'sal/inc/rtl/math.hxx')
-rw-r--r--sal/inc/rtl/math.hxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 5760340cc6a4..4891b7565647 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -357,17 +357,28 @@ inline bool isSignBitSet(double d)
*/
inline void setInf(double * pd, bool bNegative)
{
- reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw
- = bNegative ? 0xFFF00000 : 0x7FF00000;
- reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0;
+ union
+ {
+ double sd;
+ sal_math_Double md;
+ };
+ md.w32_parts.msw = bNegative ? 0xFFF00000 : 0x7FF00000;
+ md.w32_parts.lsw = 0;
+ *pd = sd;
}
/** Set a QNAN.
*/
inline void setNan(double * pd)
{
- reinterpret_cast< sal_math_Double * >(pd)->w32_parts.msw = 0x7FFFFFFF;
- reinterpret_cast< sal_math_Double * >(pd)->w32_parts.lsw = 0xFFFFFFFF;
+ union
+ {
+ double sd;
+ sal_math_Double md;
+ };
+ md.w32_parts.msw = 0x7FFFFFFF;
+ md.w32_parts.lsw = 0xFFFFFFFF;
+ *pd = sd;
}
/** If a value is a valid argument for sin(), cos(), tan().