diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-04-30 17:44:45 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-04-30 17:44:45 +0000 |
commit | 5792e16f0562d206e1ef4e611f7b43ec53c92149 (patch) | |
tree | 08f714ca88c534f3bc2214ac8dec89210bf61138 | |
parent | 02141eabb2ca4a9eef1085491759f43a99ab6581 (diff) | |
download | libxml2-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-- | ChangeLog | 5 | ||||
-rw-r--r-- | strio.h | 2 | ||||
-rw-r--r-- | tree.c | 6 | ||||
-rw-r--r-- | trio.c | 2 | ||||
-rw-r--r-- | xpath.c | 54 |
5 files changed, 47 insertions, 22 deletions
@@ -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 @@ -125,7 +125,7 @@ enum { STRIO_HASH_NONE = 0, STRIO_HASH_PLAIN, - STRIO_HASH_TWOSIGNED, + STRIO_HASH_TWOSIGNED }; #if !defined(DEBUG) || defined(__DECC) @@ -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); @@ -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) @@ -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; } |