From d0257234348f5d0ee199bb879406a8a2b80e7744 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 21 Aug 2001 11:11:21 +0000 Subject: [PATCH] use xmlXPathIsNaN() and xmlXPathIsInf() tag a potential threading problem. * libexslt/math.c libxslt/numbers.c: use xmlXPathIsNaN() and xmlXPathIsInf() * libxslt/pattern.c: tag a potential threading problem. Daniel --- ChangeLog | 6 ++++++ libexslt/math.c | 17 ++++++++--------- libxslt/numbers.c | 5 ++--- libxslt/pattern.c | 2 ++ tests/exslt/sets/Makefile.am | 2 +- tests/extensions/Makefile.am | 2 +- tests/general/Makefile.am | 2 +- tests/multiple/Makefile.am | 2 +- tests/namespaces/Makefile.am | 2 +- tests/numbers/Makefile.am | 2 +- tests/xmlspec/Makefile.am | 2 +- 11 files changed, 25 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09fe0be..9797e67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 21 13:10:03 CEST 2001 Daniel Veillard + + * libexslt/math.c libxslt/numbers.c: use xmlXPathIsNaN() and + xmlXPathIsInf() + * libxslt/pattern.c: tag a potential threading problem. + Tue Aug 21 11:18:45 CEST 2001 Bjorn Reese * libxslt/numbers.c libexslt/math.c: Re-worked NaN and Inf diff --git a/libexslt/math.c b/libexslt/math.c index 945f056..afefed6 100644 --- a/libexslt/math.c +++ b/libexslt/math.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include @@ -29,11 +28,11 @@ exsltMathMin (xmlNodeSetPtr ns) { if ((ns == NULL) || (ns->nodeNr == 0)) return(xmlXPathNAN); ret = xmlXPathCastNodeToNumber(ns->nodeTab[0]); - if (trio_isnan(ret)) + if (xmlXPathIsNaN(ret)) return(xmlXPathNAN); for (i = 1; i < ns->nodeNr; i++) { cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]); - if (trio_isnan(cur)) + if (xmlXPathIsNaN(cur)) return(xmlXPathNAN); if (cur < ret) ret = cur; @@ -90,11 +89,11 @@ exsltMathMax (xmlNodeSetPtr ns) { if ((ns == NULL) || (ns->nodeNr == 0)) return(xmlXPathNAN); ret = xmlXPathCastNodeToNumber(ns->nodeTab[0]); - if (trio_isnan(ret)) + if (xmlXPathIsNaN(ret)) return(xmlXPathNAN); for (i = 1; i < ns->nodeNr; i++) { cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]); - if (trio_isnan(cur)) + if (xmlXPathIsNaN(cur)) return(xmlXPathNAN); if (cur > ret) ret = cur; @@ -149,14 +148,14 @@ exsltMathHighest (xmlNodeSetPtr ns) { return(ret); max = xmlXPathCastNodeToNumber(ns->nodeTab[0]); - if (trio_isnan(max)) + if (xmlXPathIsNaN(max)) return(ret); else xmlXPathNodeSetAddUnique(ret, ns->nodeTab[0]); for (i = 1; i < ns->nodeNr; i++) { cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]); - if (trio_isnan(cur)) { + if (xmlXPathIsNaN(cur)) { xmlXPathEmptyNodeSet(ret); return(ret); } @@ -220,14 +219,14 @@ exsltMathLowest (xmlNodeSetPtr ns) { return(ret); min = xmlXPathCastNodeToNumber(ns->nodeTab[0]); - if (trio_isnan(min)) + if (xmlXPathIsNaN(min)) return(ret); else xmlXPathNodeSetAddUnique(ret, ns->nodeTab[0]); for (i = 1; i < ns->nodeNr; i++) { cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]); - if (trio_isnan(cur)) { + if (xmlXPathIsNaN(cur)) { xmlXPathEmptyNodeSet(ret); return(ret); } diff --git a/libxslt/numbers.c b/libxslt/numbers.c index eb0d2d0..7086abc 100644 --- a/libxslt/numbers.c +++ b/libxslt/numbers.c @@ -20,7 +20,6 @@ #include #include #include -#include #include "xsltutils.h" #include "pattern.h" #include "templates.h" @@ -301,7 +300,7 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, is_last_default_token = (i >= numbers_max - 1); } - switch (trio_isinf(number)) { + switch (xmlXPathIsInf(number)) { case -1: xmlBufferCCat(buffer, "-Infinity"); break; @@ -309,7 +308,7 @@ xsltNumberFormatInsertNumbers(xsltNumberDataPtr data, xmlBufferCCat(buffer, "Infinity"); break; default: - if (trio_isnan(number)) { + if (xmlXPathIsNaN(number)) { xmlBufferCCat(buffer, "NaN"); } else { diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 44bcbd5..2d47974 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -556,6 +556,8 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, /* * Depending on the last selection, one may need to * recompute contextSize and proximityPosition. + * + * TODO: make this thread safe ! */ oldCS = ctxt->xpathCtxt->contextSize; oldCP = ctxt->xpathCtxt->proximityPosition; diff --git a/tests/exslt/sets/Makefile.am b/tests/exslt/sets/Makefile.am index 223e2c7..084aaaa 100644 --- a/tests/exslt/sets/Makefile.am +++ b/tests/exslt/sets/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../../xsltproc ; make xsltproc) + @(cd ../../../xsltproc ; xsltproc) EXTRA_DIST = \ difference.1.out difference.1.xml difference.1.xsl \ diff --git a/tests/extensions/Makefile.am b/tests/extensions/Makefile.am index df0ed74..68aa380 100644 --- a/tests/extensions/Makefile.am +++ b/tests/extensions/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = \ module.xml module.xsl module.out \ diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index d834ae9..70f6568 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = \ bug-1-.out bug-1-.xsl \ diff --git a/tests/multiple/Makefile.am b/tests/multiple/Makefile.am index 3e23d38..e62c5d3 100644 --- a/tests/multiple/Makefile.am +++ b/tests/multiple/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = dict.dtd dict.xml dict.xsl result.xml \ out/lettera.orig out/letterb.orig \ diff --git a/tests/namespaces/Makefile.am b/tests/namespaces/Makefile.am index 8654924..72c5360 100644 --- a/tests/namespaces/Makefile.am +++ b/tests/namespaces/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = \ tst.xml tst.xsl tst.out \ diff --git a/tests/numbers/Makefile.am b/tests/numbers/Makefile.am index 6099185..8f1ca76 100644 --- a/tests/numbers/Makefile.am +++ b/tests/numbers/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = format-number.xsl format-number.xml format-number.out diff --git a/tests/xmlspec/Makefile.am b/tests/xmlspec/Makefile.am index 9e02e3b..4c62c82 100644 --- a/tests/xmlspec/Makefile.am +++ b/tests/xmlspec/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in $(top_builddir)/xsltproc/xsltproc: - @(cd ../../xsltproc ; make xsltproc) + @(cd ../../xsltproc ; xsltproc) EXTRA_DIST = REC-xml-20001006.xml xmlspec-v21.dtd W3C-REC.css \ logo-REC xmlspec.xsl REC-xml-2e.xsl diffspec.xsl \ -- 2.7.4