summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-04-30 17:44:45 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-04-30 17:44:45 +0000
commit5792e16f0562d206e1ef4e611f7b43ec53c92149 (patch)
tree08f714ca88c534f3bc2214ac8dec89210bf61138
parent02141eabb2ca4a9eef1085491759f43a99ab6581 (diff)
downloadlibxml2-5792e16f0562d206e1ef4e611f7b43ec53c92149.tar.gz
- strio.h trio.c: Dan McNichol suggested a couple of small
fixes for AIX 4.3.3 using Visual Age 5.0.2 compiler Daniel
-rw-r--r--ChangeLog5
-rw-r--r--strio.h2
-rw-r--r--tree.c6
-rw-r--r--trio.c2
-rw-r--r--xpath.c54
5 files changed, 47 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index ac42d421..90392865 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Apr 30 19:42:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * strio.h trio.c: Dan McNichol suggested a couple of small
+ fixes for AIX 4.3.3 using Visual Age 5.0.2 compiler
+
Mon Apr 30 13:44:48 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* tree.c parser.c encoding.c: spent a bit more time looking
diff --git a/strio.h b/strio.h
index 2a1da362..3bb05dbb 100644
--- a/strio.h
+++ b/strio.h
@@ -125,7 +125,7 @@
enum {
STRIO_HASH_NONE = 0,
STRIO_HASH_PLAIN,
- STRIO_HASH_TWOSIGNED,
+ STRIO_HASH_TWOSIGNED
};
#if !defined(DEBUG) || defined(__DECC)
diff --git a/tree.c b/tree.c
index d1dfc27e..53f47e25 100644
--- a/tree.c
+++ b/tree.c
@@ -4286,7 +4286,8 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
if ((xmlStrEqual(prop->name, name)) &&
(((prop->ns == NULL) && (node->ns != NULL) &&
(xmlStrEqual(node->ns->href, namespace))) ||
- ((prop->ns != NULL) && (xmlStrEqual(prop->ns->href, namespace))))) {
+ ((prop->ns != NULL) &&
+ (xmlStrEqual(prop->ns->href, namespace))))) {
xmlChar *ret;
ret = xmlNodeListGetString(node->doc, prop->children, 1);
@@ -4303,8 +4304,9 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
*/
doc = node->doc;
if (doc != NULL) {
- xmlAttributePtr attrDecl;
if (doc->intSubset != NULL) {
+ xmlAttributePtr attrDecl;
+
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
diff --git a/trio.c b/trio.c
index 84b4a2b8..241d6c22 100644
--- a/trio.c
+++ b/trio.c
@@ -238,7 +238,7 @@ enum {
/* Maximal length of locale separator strings */
MAX_LOCALE_SEPARATOR_LENGTH = 64,
/* Maximal number of integers in grouping */
- MAX_LOCALE_GROUPS = 64,
+ MAX_LOCALE_GROUPS = 64
};
#define NO_GROUPING ((int)CHAR_MAX)
diff --git a/xpath.c b/xpath.c
index 5b6e84c1..d65f2513 100644
--- a/xpath.c
+++ b/xpath.c
@@ -39,9 +39,8 @@
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
-#if defined(__osf__) && defined(__GNUC__)
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
-#define FPE_WORKAROUND
#endif
#include <libxml/xmlmemory.h>
@@ -65,6 +64,7 @@
void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
double xmlXPathStringEvalNumber(const xmlChar *str);
+double xmlXPathDivideBy(double f, double fzero);
/************************************************************************
* *
@@ -150,6 +150,37 @@ int isinf(double x)
#endif /* ! HAVE_iSNAN */
#endif /* ! defined(isnan) */
+
+/**
+ * xmlXPathDivideBy:
+ *
+ * The best way found so far to generate the NAN, +-INF
+ * without hitting a compiler bug or optimization :-\
+ *
+ * Returns the double resulting from the division
+ */
+double
+xmlXPathDivideBy(double f, double fzero) {
+ float ret;
+#ifdef HAVE_SIGNAL
+#ifdef SIGFPE
+#ifdef SIG_IGN
+ void (*sighandler)(int);
+ sighandler = signal(SIGFPE, SIG_IGN);
+#endif
+#endif
+#endif
+ ret = f / fzero;
+#ifdef HAVE_SIGNAL
+#ifdef SIGFPE
+#ifdef SIG_IGN
+ signal(SIGFPE, sighandler);
+#endif
+#endif
+#endif
+ return(ret);
+}
+
/**
* xmlXPathInit:
*
@@ -161,22 +192,9 @@ xmlXPathInit(void) {
if (initialized) return;
-#ifdef FPE_WORKAROUND
- signal(SIGFPE, SIG_IGN);
-#endif
-
-#ifdef XPATH_USE_DIVISION_SHORTCUTS
- xmlXPathNAN = 0;
- xmlXPathNAN /= 0.0;
- xmlXPathPINF = 1;
- xmlXPathPINF /= 0.0;
- xmlXPathNINF = -1;
- xmlXPathNINF /= 0.0;
-#else
- xmlXPathNAN = 0.0 / 0.0;
- xmlXPathPINF = 1 / 0.0;
- xmlXPathNINF = -1 / 0.0;
-#endif
+ xmlXPathNAN = xmlXPathDivideBy(0.0, 0.0);
+ xmlXPathPINF = xmlXPathDivideBy(1.0, 0.0);
+ xmlXPathPINF = xmlXPathDivideBy(-1.0, 0.0);
initialized = 1;
}