diff options
author | rillig <rillig@pkgsrc.org> | 2008-01-13 22:42:06 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2008-01-13 22:42:06 +0000 |
commit | 09a0df93d888ab758d728ebcde3cf85979607dda (patch) | |
tree | 9686ab3557494a41bd5874ae4a870332cead88db /devel/libbinio | |
parent | 584a160f4ab8d1b1876336c72e10378e76c5a19a (diff) | |
download | pkgsrc-09a0df93d888ab758d728ebcde3cf85979607dda.tar.gz |
Added a patch for sunpro.
Diffstat (limited to 'devel/libbinio')
-rw-r--r-- | devel/libbinio/distinfo | 3 | ||||
-rw-r--r-- | devel/libbinio/patches/patch-aa | 47 |
2 files changed, 49 insertions, 1 deletions
diff --git a/devel/libbinio/distinfo b/devel/libbinio/distinfo index 4905a87182d..9130e03f697 100644 --- a/devel/libbinio/distinfo +++ b/devel/libbinio/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.1.1.1 2007/09/10 15:50:11 xtraeme Exp $ +$NetBSD: distinfo,v 1.2 2008/01/13 22:42:06 rillig Exp $ SHA1 (libbinio-1.4.tar.bz2) = 47db5f7448245f38b9d26c8b11f53a07b6f6da73 RMD160 (libbinio-1.4.tar.bz2) = 4c80c3e5d9f5eb4e3632df85667a14f8714796b1 Size (libbinio-1.4.tar.bz2) = 307664 bytes +SHA1 (patch-aa) = 2626bddd8422f496076e944b0b641564b0450de9 diff --git a/devel/libbinio/patches/patch-aa b/devel/libbinio/patches/patch-aa new file mode 100644 index 00000000000..077b18c7fcd --- /dev/null +++ b/devel/libbinio/patches/patch-aa @@ -0,0 +1,47 @@ +$NetBSD: patch-aa,v 1.1 2008/01/13 22:42:07 rillig Exp $ + +Sun Studio C++ is very picky about the correct prototypes. It doesn't +resolve pow(int, int) to one of pow(double, int) and pow(long double, +int). It also cannot decide for pow(double, unsigned int) whether it +should be pow(double, int) (which _might_ invoke undefined behavior) +and pow(double, double). + +--- src/binio.cpp.orig 2004-08-18 21:41:20.000000000 +0200 ++++ src/binio.cpp 2007-12-05 18:16:12.361936000 +0100 +@@ -215,9 +215,9 @@ binistream::Float binistream::ieee_singl + } + + if(!exp) // Unnormalized float values +- return sign * pow(2, -126) * fract * pow(2, -23); ++ return sign * pow(2.0, -126) * fract * pow(2.0, -23); + else // Normalized float values +- return sign * pow(2, exp - 127) * (fract * pow(2, -23) + 1); ++ return sign * pow(2.0, int(exp - 127)) * (fract * pow(2.0, -23) + 1); + + err |= Fatal; return 0.0; + } +@@ -227,9 +227,9 @@ binistream::Float binistream::ieee_doubl + signed int sign = data[0] >> 7 ? -1 : 1; + unsigned int exp = ((unsigned int)(data[0] & 0x7f) << 4) | (data[1] >> 4), + fracthi4 = data[1] & 0xf; +- Float fract = fracthi4 * pow(2, 48) + data[2] * pow(2, 40) + data[3] * +- pow(2, 32) + data[4] * pow(2, 24) + data[5] * pow(2, 16) + data[6] * +- pow(2, 8) + data[7]; ++ Float fract = fracthi4 * pow(2.0, 48) + data[2] * pow(2.0, 40) + data[3] * ++ pow(2.0, 32) + data[4] * pow(2.0, 24) + data[5] * pow(2.0, 16) + data[6] * ++ pow(2.0, 8) + data[7]; + + // Signed and unsigned zero + if(!exp && !fracthi4 && !data[2] && !data[3] && !data[4] && !data[5] && +@@ -254,9 +254,9 @@ binistream::Float binistream::ieee_doubl + } + + if(!exp) // Unnormalized float values +- return sign * pow(2, -1022) * fract * pow(2, -52); ++ return sign * pow(2.0, -1022) * fract * pow(2.0, -52); + else // Normalized float values +- return sign * pow(2, exp - 1023) * (fract * pow(2, -52) + 1); ++ return sign * pow(2.0, int(exp - 1023)) * (fract * pow(2.0, -52) + 1); + + err |= Fatal; return 0.0; + } |