summaryrefslogtreecommitdiff
path: root/lib/libc/powerpc
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2004-02-16 10:02:40 +0000
committerDavid Schultz <das@FreeBSD.org>2004-02-16 10:02:40 +0000
commit36e22bed27863665234a9409ffc9dc50b79bf1a7 (patch)
tree28236bec651e918042d6ae062eb49a4f35ac208d /lib/libc/powerpc
parent7ccbdc0d2298b12098d99307096300ff8f87ffc7 (diff)
Notes
Diffstat (limited to 'lib/libc/powerpc')
-rw-r--r--lib/libc/powerpc/gen/isinf.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/libc/powerpc/gen/isinf.c b/lib/libc/powerpc/gen/isinf.c
index fb6d73b9816b..0b9ef6cbaeeb 100644
--- a/lib/libc/powerpc/gen/isinf.c
+++ b/lib/libc/powerpc/gen/isinf.c
@@ -43,17 +43,25 @@ __FBSDID("$FreeBSD$");
int
isnan(double d)
{
- struct ieee_double *p = (struct ieee_double *)&d;
+ union {
+ double v;
+ struct ieee_double s;
+ } u;
- return (p->dbl_exp == DBL_EXP_INFNAN &&
- (p->dbl_frach || p->dbl_fracl));
+ u.v = d;
+ return (u.s.dbl_exp == DBL_EXP_INFNAN &&
+ (u.s.dbl_frach || u.s.dbl_fracl));
}
int
isinf(double d)
{
- struct ieee_double *p = (struct ieee_double *)&d;
+ union {
+ double v;
+ struct ieee_double s;
+ } u;
- return (p->dbl_exp == DBL_EXP_INFNAN &&
- !p->dbl_frach && !p->dbl_fracl);
+ u.v = d;
+ return (u.s.dbl_exp == DBL_EXP_INFNAN &&
+ !u.s.dbl_frach && !u.s.dbl_fracl);
}