diff options
author | martin <martin@pkgsrc.org> | 2005-06-22 22:05:34 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2005-06-22 22:05:34 +0000 |
commit | a546ff77cc22435d93b9a450c42bbd93d625a326 (patch) | |
tree | 5cdd53ad3265071350a6557d43808ccbce3d8334 /www/mozilla/patches | |
parent | bda17626d9ee3ce483d3f2744eb5e83dd5eead62 (diff) | |
download | pkgsrc-a546ff77cc22435d93b9a450c42bbd93d625a326.tar.gz |
Re-instantiate the NAN/INFINITY fixes, this time in a way that works on
older C environments as well.
Diffstat (limited to 'www/mozilla/patches')
-rw-r--r-- | www/mozilla/patches/patch-cg | 85 | ||||
-rw-r--r-- | www/mozilla/patches/patch-ch | 18 | ||||
-rw-r--r-- | www/mozilla/patches/patch-ci | 13 | ||||
-rw-r--r-- | www/mozilla/patches/patch-cj | 32 | ||||
-rw-r--r-- | www/mozilla/patches/patch-ck | 19 | ||||
-rw-r--r-- | www/mozilla/patches/patch-cl | 31 | ||||
-rw-r--r-- | www/mozilla/patches/patch-cm | 13 |
7 files changed, 211 insertions, 0 deletions
diff --git a/www/mozilla/patches/patch-cg b/www/mozilla/patches/patch-cg new file mode 100644 index 00000000000..80b00a49e35 --- /dev/null +++ b/www/mozilla/patches/patch-cg @@ -0,0 +1,85 @@ +$NetBSD: patch-cg,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/base/Double.cpp.orig 2004-01-15 22:23:18.000000000 +0100 ++++ extensions/transformiix/source/base/Double.cpp 2005-06-20 11:26:26.000000000 +0200 +@@ -48,6 +48,38 @@ + * Utility class for doubles + */ + ++#if defined(INFINITY) && defined(NAN) ++double Double::NaN() ++{ ++ return NAN; ++} ++ ++double Double::PositiveInfinity() ++{ ++ return INFINITY; ++} ++ ++double Double::NegativeInfinity() ++{ ++ return -INFINITY; ++} ++ ++MBool Double::isInfinite(double aDbl) ++{ ++ return isinf(aDbl); ++} ++ ++MBool Double::isNaN(double aDbl) ++{ ++ return isnan(aDbl); ++} ++ ++MBool Double::isNeg(double aDbl) ++{ ++ return aDbl<0.0; ++} ++#else /* pre INFINITY C environment */ ++ + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D. + #ifdef __FreeBSD__ + #include <ieeefp.h> +@@ -127,9 +159,20 @@ + const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}; + #endif + +-const double Double::NaN = *((double*)nanMask); +-const double Double::POSITIVE_INFINITY = *((double*)infMask); +-const double Double::NEGATIVE_INFINITY = *((double*)negInfMask); ++double Double::NaN() ++{ ++ return *((double*)nanMask); ++} ++ ++double Double::PositiveInfinity() ++{ ++ return *((double*)infMask); ++} ++ ++double Double::NegativeInfinity() ++{ ++ return *((double*)negInfMask); ++} + + /* + * Determines whether the given double represents positive or negative +@@ -157,6 +200,7 @@ + { + return (TX_DOUBLE_HI32(aDbl) & TX_DOUBLE_HI32_SIGNBIT) != 0; + } ++#endif /* C environment has INFINITY and NAN */ + + /* + * Converts the given String to a double, if the String value does not +@@ -244,7 +288,7 @@ + { + if (mState == eIllegal || mBuffer.IsEmpty() || + (mBuffer.Length() == 1 && mBuffer[0] == '.')) { +- return Double::NaN; ++ return Double::NaN(); + } + return mSign*PR_strtod(mBuffer.get(), 0); + } + diff --git a/www/mozilla/patches/patch-ch b/www/mozilla/patches/patch-ch new file mode 100644 index 00000000000..a4b6c4fb3a6 --- /dev/null +++ b/www/mozilla/patches/patch-ch @@ -0,0 +1,18 @@ +$NetBSD: patch-ch,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/base/primitives.h.orig 2003-01-17 13:43:05.000000000 +0100 ++++ extensions/transformiix/source/base/primitives.h 2005-06-16 09:46:56.000000000 +0200 +@@ -51,10 +51,9 @@ + /* + * Usefull constants + */ +- +- static const double NaN; +- static const double POSITIVE_INFINITY; +- static const double NEGATIVE_INFINITY; ++ static double NaN(); ++ static double PositiveInfinity(); ++ static double NegativeInfinity(); + + /* + * Determines whether the given double represents positive or negative diff --git a/www/mozilla/patches/patch-ci b/www/mozilla/patches/patch-ci new file mode 100644 index 00000000000..483b6dbe4d3 --- /dev/null +++ b/www/mozilla/patches/patch-ci @@ -0,0 +1,13 @@ +$NetBSD: patch-ci,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/xpath/FunctionCall.cpp.orig 2003-11-04 16:13:03.000000000 +0100 ++++ extensions/transformiix/source/xpath/FunctionCall.cpp 2005-06-16 09:14:19.000000000 +0200 +@@ -92,7 +92,7 @@ + nsRefPtr<txAExprResult> exprResult; + nsresult rv = aExpr->evaluate(aContext, getter_AddRefs(exprResult)); + if (NS_FAILED(rv)) +- return Double::NaN; ++ return Double::NaN(); + + return exprResult->numberValue(); + } diff --git a/www/mozilla/patches/patch-cj b/www/mozilla/patches/patch-cj new file mode 100644 index 00000000000..633d7da8dff --- /dev/null +++ b/www/mozilla/patches/patch-cj @@ -0,0 +1,32 @@ +$NetBSD: patch-cj,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/xpath/MultiplicativeExpr.cpp.orig 2003-11-20 00:06:14.000000000 +0100 ++++ extensions/transformiix/source/xpath/MultiplicativeExpr.cpp 2005-06-16 09:29:24.000000000 +0200 +@@ -71,22 +71,22 @@ + #if defined(XP_WIN) + /* XXX MSVC miscompiles such that (NaN == 0) */ + if (Double::isNaN(rightDbl)) +- result = Double::NaN; ++ result = Double::NaN(); + else + #endif + if (leftDbl == 0 || Double::isNaN(leftDbl)) +- result = Double::NaN; ++ result = Double::NaN(); + else if (Double::isNeg(leftDbl) ^ Double::isNeg(rightDbl)) +- result = Double::NEGATIVE_INFINITY; ++ result = Double::NegativeInfinity(); + else +- result = Double::POSITIVE_INFINITY; ++ result = Double::PositiveInfinity(); + } + else + result = leftDbl / rightDbl; + break; + case MODULUS: + if (rightDbl == 0) { +- result = Double::NaN; ++ result = Double::NaN(); + } + else { + #if defined(XP_WIN) diff --git a/www/mozilla/patches/patch-ck b/www/mozilla/patches/patch-ck new file mode 100644 index 00000000000..deef2325ac1 --- /dev/null +++ b/www/mozilla/patches/patch-ck @@ -0,0 +1,19 @@ +$NetBSD: patch-ck,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/xslt/functions/txFormatNumberFunctionCall.cpp.orig 2003-06-17 00:31:17.000000000 +0200 ++++ extensions/transformiix/source/xslt/functions/txFormatNumberFunctionCall.cpp 2005-06-16 10:06:22.000000000 +0200 +@@ -112,12 +112,12 @@ + return aContext->recycler()->getStringResult(format->mNaN, aResult); + } + +- if (value == Double::POSITIVE_INFINITY) { ++ if (value == Double::PositiveInfinity()) { + return aContext->recycler()->getStringResult(format->mInfinity, + aResult); + } + +- if (value == Double::NEGATIVE_INFINITY) { ++ if (value == Double::NegativeInfinity()) { + nsAutoString res; + res.Append(format->mMinusSign); + res.Append(format->mInfinity); diff --git a/www/mozilla/patches/patch-cl b/www/mozilla/patches/patch-cl new file mode 100644 index 00000000000..47126ab77e2 --- /dev/null +++ b/www/mozilla/patches/patch-cl @@ -0,0 +1,31 @@ +$NetBSD: patch-cl,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/xslt/txStylesheetCompileHandlers.cpp.orig 2004-01-29 23:04:29.000000000 +0100 ++++ extensions/transformiix/source/xslt/txStylesheetCompileHandlers.cpp 2005-06-16 09:18:13.000000000 +0200 +@@ -258,7 +258,7 @@ + txStylesheetCompilerState& aState, + double& aNumber) + { +- aNumber = Double::NaN; ++ aNumber = Double::NaN(); + txStylesheetAttr* attr = nsnull; + nsresult rv = getStyleAttr(aAttributes, aAttrCount, kNameSpaceID_None, + aName, aRequired, &attr); +@@ -479,7 +479,7 @@ + NS_ENSURE_SUCCESS(rv, rv); + + txExpandedName nullExpr; +- double prio = Double::NaN; ++ double prio = Double::NaN(); + nsAutoPtr<txPattern> match(new txRootPattern(MB_TRUE)); + NS_ENSURE_TRUE(match, NS_ERROR_OUT_OF_MEMORY); + +@@ -1038,7 +1038,7 @@ + aState, mode); + NS_ENSURE_SUCCESS(rv, rv); + +- double prio = Double::NaN; ++ double prio = Double::NaN(); + rv = getNumberAttr(aAttributes, aAttrCount, txXSLTAtoms::priority, + PR_FALSE, aState, prio); + NS_ENSURE_SUCCESS(rv, rv); diff --git a/www/mozilla/patches/patch-cm b/www/mozilla/patches/patch-cm new file mode 100644 index 00000000000..844a46f0c1c --- /dev/null +++ b/www/mozilla/patches/patch-cm @@ -0,0 +1,13 @@ +$NetBSD: patch-cm,v 1.3 2005/06/22 22:05:34 martin Exp $ + +--- extensions/transformiix/source/xslt/txXSLTPatterns.cpp.orig 2003-11-18 23:56:46.000000000 +0100 ++++ extensions/transformiix/source/xslt/txXSLTPatterns.cpp 2005-06-16 09:17:00.000000000 +0200 +@@ -99,7 +99,7 @@ + double txUnionPattern::getDefaultPriority() + { + NS_ASSERTION(0, "Don't call getDefaultPriority on txUnionPattern"); +- return Double::NaN; ++ return Double::NaN(); + } + + /* |