- 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
diff --git a/ChangeLog b/ChangeLog
index ac42d42..9039286 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 2a1da36..3bb05db 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 d1dfc27..53f47e2 100644
--- a/tree.c
+++ b/tree.c
@@ -4286,7 +4286,8 @@
         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 @@
      */
     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 84b4a2b..241d6c2 100644
--- a/trio.c
+++ b/trio.c
@@ -238,7 +238,7 @@
   /* 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 5b6e84c..d65f251 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 @@
 #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 @@
 
     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;
 }