1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

- 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
This commit is contained in:
Daniel Veillard
2001-04-30 17:44:45 +00:00
parent 02141eabb2
commit 5792e16f05
5 changed files with 47 additions and 22 deletions

View File

@ -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> 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 * tree.c parser.c encoding.c: spent a bit more time looking

View File

@ -125,7 +125,7 @@
enum { enum {
STRIO_HASH_NONE = 0, STRIO_HASH_NONE = 0,
STRIO_HASH_PLAIN, STRIO_HASH_PLAIN,
STRIO_HASH_TWOSIGNED, STRIO_HASH_TWOSIGNED
}; };
#if !defined(DEBUG) || defined(__DECC) #if !defined(DEBUG) || defined(__DECC)

6
tree.c
View File

@ -4286,7 +4286,8 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
if ((xmlStrEqual(prop->name, name)) && if ((xmlStrEqual(prop->name, name)) &&
(((prop->ns == NULL) && (node->ns != NULL) && (((prop->ns == NULL) && (node->ns != NULL) &&
(xmlStrEqual(node->ns->href, namespace))) || (xmlStrEqual(node->ns->href, namespace))) ||
((prop->ns != NULL) && (xmlStrEqual(prop->ns->href, namespace))))) { ((prop->ns != NULL) &&
(xmlStrEqual(prop->ns->href, namespace))))) {
xmlChar *ret; xmlChar *ret;
ret = xmlNodeListGetString(node->doc, prop->children, 1); ret = xmlNodeListGetString(node->doc, prop->children, 1);
@ -4303,8 +4304,9 @@ xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
*/ */
doc = node->doc; doc = node->doc;
if (doc != NULL) { if (doc != NULL) {
xmlAttributePtr attrDecl;
if (doc->intSubset != NULL) { if (doc->intSubset != NULL) {
xmlAttributePtr attrDecl;
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
if ((attrDecl == NULL) && (doc->extSubset != NULL)) if ((attrDecl == NULL) && (doc->extSubset != NULL))
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name); attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);

2
trio.c
View File

@ -238,7 +238,7 @@ enum {
/* Maximal length of locale separator strings */ /* Maximal length of locale separator strings */
MAX_LOCALE_SEPARATOR_LENGTH = 64, MAX_LOCALE_SEPARATOR_LENGTH = 64,
/* Maximal number of integers in grouping */ /* Maximal number of integers in grouping */
MAX_LOCALE_GROUPS = 64, MAX_LOCALE_GROUPS = 64
}; };
#define NO_GROUPING ((int)CHAR_MAX) #define NO_GROUPING ((int)CHAR_MAX)

54
xpath.c
View File

@ -39,9 +39,8 @@
#ifdef HAVE_CTYPE_H #ifdef HAVE_CTYPE_H
#include <ctype.h> #include <ctype.h>
#endif #endif
#if defined(__osf__) && defined(__GNUC__) #ifdef HAVE_SIGNAL_H
#include <signal.h> #include <signal.h>
#define FPE_WORKAROUND
#endif #endif
#include <libxml/xmlmemory.h> #include <libxml/xmlmemory.h>
@ -65,6 +64,7 @@
void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs); void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
double xmlXPathStringEvalNumber(const xmlChar *str); double xmlXPathStringEvalNumber(const xmlChar *str);
double xmlXPathDivideBy(double f, double fzero);
/************************************************************************ /************************************************************************
* * * *
@ -150,6 +150,37 @@ int isinf(double x)
#endif /* ! HAVE_iSNAN */ #endif /* ! HAVE_iSNAN */
#endif /* ! defined(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: * xmlXPathInit:
* *
@ -161,22 +192,9 @@ xmlXPathInit(void) {
if (initialized) return; if (initialized) return;
#ifdef FPE_WORKAROUND xmlXPathNAN = xmlXPathDivideBy(0.0, 0.0);
signal(SIGFPE, SIG_IGN); xmlXPathPINF = xmlXPathDivideBy(1.0, 0.0);
#endif xmlXPathPINF = xmlXPathDivideBy(-1.0, 0.0);
#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
initialized = 1; initialized = 1;
} }