summaryrefslogtreecommitdiffstats
path: root/lib/libc/quad/floatunsdidf.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2004-04-27 17:46:46 +0000
committerotto <otto@openbsd.org>2004-04-27 17:46:46 +0000
commit99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f (patch)
tree1e8c75d2d5dda9d3c6463cc88fa8f87f423635fc /lib/libc/quad/floatunsdidf.c
parentunbreak^2 (diff)
downloadwireguard-openbsd-99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f.tar.xz
wireguard-openbsd-99ae6da7b858227f6f2d3e8bf2bc3ae3e8dc902f.zip
A quad is two ints, not two longs. Also fix some problems with
conversions from floating point to quad. Problem reported by Marcus Holland-Moritz. From NetBSD. ok millert@
Diffstat (limited to 'lib/libc/quad/floatunsdidf.c')
-rw-r--r--lib/libc/quad/floatunsdidf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/quad/floatunsdidf.c b/lib/libc/quad/floatunsdidf.c
index c7ce30774f5..37028adbbf0 100644
--- a/lib/libc/quad/floatunsdidf.c
+++ b/lib/libc/quad/floatunsdidf.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: floatunsdidf.c,v 1.3 2003/06/02 20:18:36 millert Exp $";
+static char rcsid[] = "$OpenBSD: floatunsdidf.c,v 1.4 2004/04/27 17:46:46 otto Exp $";
#endif /* LIBC_SCCS and not lint */
#include "quad.h"
@@ -49,7 +49,7 @@ __floatunsdidf(x)
union uu u;
u.uq = x;
- d = (double)u.ul[H] * (((long)1 << (LONG_BITS - 2)) * 4.0);
+ d = (double)u.ul[H] * (((int)1 << (INT_BITS - 2)) * 4.0);
d += u.ul[L];
return (d);
}