1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2026-01-07 21:58:22 +03:00

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
This commit is contained in:
Daniel Veillard
2001-08-21 11:11:21 +00:00
parent c6604a959b
commit d025723434
11 changed files with 25 additions and 19 deletions

View File

@@ -1,3 +1,9 @@
Tue Aug 21 13:10:03 CEST 2001 Daniel Veillard <daniel@veillard.com>
* 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 <breese@users.sourceforge.net>
* libxslt/numbers.c libexslt/math.c: Re-worked NaN and Inf

View File

@@ -1,7 +1,6 @@
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/trionan.h>
#include <libxslt/xsltconfig.h>
#include <libxslt/xsltutils.h>
@@ -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);
}

View File

@@ -20,7 +20,6 @@
#include <libxml/parserInternals.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/trionan.h>
#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 {

View File

@@ -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;

View File

@@ -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 \

View File

@@ -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 \

View File

@@ -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 \

View File

@@ -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 \

View File

@@ -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 \

View File

@@ -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

View File

@@ -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 \