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:
@ -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
|
||||
|
2
strio.h
2
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)
|
||||
|
6
tree.c
6
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);
|
||||
|
2
trio.c
2
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)
|
||||
|
54
xpath.c
54
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user