mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
minor change to avoid compilation warnings on some (e.g. AIX) systems
* HTMLparser.c, entities.c, xmlreader.c: minor change to avoid compilation warnings on some (e.g. AIX) systems
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Fri Sep 26 11:03:08 PDT 2003 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
|
* HTMLparser.c, entities.c, xmlreader.c: minor change to
|
||||||
|
avoid compilation warnings on some (e.g. AIX) systems
|
||||||
|
|
||||||
Fri Sep 26 16:49:25 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
Fri Sep 26 16:49:25 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parserInternals.c: fixed a backward compatibility problem
|
* parserInternals.c: fixed a backward compatibility problem
|
||||||
|
29
HTMLparser.c
29
HTMLparser.c
@ -1037,10 +1037,11 @@ static void
|
|||||||
htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
||||||
{
|
{
|
||||||
const htmlElemDesc *info;
|
const htmlElemDesc *info;
|
||||||
const xmlChar *oldname;
|
|
||||||
int i, priority;
|
int i, priority;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
const xmlChar *oldname;
|
||||||
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"Close of %s stack: %d elements\n", newtag,
|
"Close of %s stack: %d elements\n", newtag,
|
||||||
ctxt->nameNr);
|
ctxt->nameNr);
|
||||||
@ -1090,12 +1091,14 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
|||||||
}
|
}
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
||||||
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
||||||
oldname = htmlnamePop(ctxt);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
oldname = htmlnamePop(ctxt);
|
||||||
if (oldname != NULL) {
|
if (oldname != NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"htmlAutoCloseOnClose: popped %s\n", oldname);
|
"htmlAutoCloseOnClose: popped %s\n", oldname);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
htmlnamePop(ctxt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1109,16 +1112,16 @@ htmlAutoCloseOnClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
|||||||
static void
|
static void
|
||||||
htmlAutoCloseOnEnd(htmlParserCtxtPtr ctxt)
|
htmlAutoCloseOnEnd(htmlParserCtxtPtr ctxt)
|
||||||
{
|
{
|
||||||
const xmlChar *oldname;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (ctxt->nameNr == 0)
|
|
||||||
return;
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
const xmlChar *oldname;
|
||||||
|
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"Close of stack: %d elements\n", ctxt->nameNr);
|
"Close of stack: %d elements\n", ctxt->nameNr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (ctxt->nameNr == 0)
|
||||||
|
return;
|
||||||
for (i = (ctxt->nameNr - 1); i >= 0; i--) {
|
for (i = (ctxt->nameNr - 1); i >= 0; i--) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
xmlGenericError(xmlGenericErrorContext, "%d : %s\n", i,
|
xmlGenericError(xmlGenericErrorContext, "%d : %s\n", i,
|
||||||
@ -1126,12 +1129,14 @@ htmlAutoCloseOnEnd(htmlParserCtxtPtr ctxt)
|
|||||||
#endif
|
#endif
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
||||||
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
||||||
oldname = htmlnamePop(ctxt);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
oldname = htmlnamePop(ctxt);
|
||||||
if (oldname != NULL) {
|
if (oldname != NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"htmlAutoCloseOnEnd: popped %s\n", oldname);
|
"htmlAutoCloseOnEnd: popped %s\n", oldname);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
htmlnamePop(ctxt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1151,7 +1156,9 @@ htmlAutoCloseOnEnd(htmlParserCtxtPtr ctxt)
|
|||||||
static void
|
static void
|
||||||
htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
const xmlChar *oldname;
|
const xmlChar *oldname;
|
||||||
|
#endif
|
||||||
|
|
||||||
while ((newtag != NULL) && (ctxt->name != NULL) &&
|
while ((newtag != NULL) && (ctxt->name != NULL) &&
|
||||||
(htmlCheckAutoClose(newtag, ctxt->name))) {
|
(htmlCheckAutoClose(newtag, ctxt->name))) {
|
||||||
@ -1162,12 +1169,14 @@ htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
|||||||
#endif
|
#endif
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
||||||
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
||||||
oldname = htmlnamePop(ctxt);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
oldname = htmlnamePop(ctxt);
|
||||||
if (oldname != NULL) {
|
if (oldname != NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"htmlAutoClose: popped %s\n", oldname);
|
"htmlAutoClose: popped %s\n", oldname);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
htmlnamePop(ctxt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (newtag == NULL) {
|
if (newtag == NULL) {
|
||||||
@ -1184,12 +1193,14 @@ htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
|
|||||||
#endif
|
#endif
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
|
||||||
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
ctxt->sax->endElement(ctxt->userData, ctxt->name);
|
||||||
oldname = htmlnamePop(ctxt);
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
oldname = htmlnamePop(ctxt);
|
||||||
if (oldname != NULL) {
|
if (oldname != NULL) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"htmlAutoClose: popped %s\n", oldname);
|
"htmlAutoClose: popped %s\n", oldname);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
htmlnamePop(ctxt);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -771,11 +771,13 @@ xmlEncodeSpecialChars(xmlDocPtr doc, const xmlChar *input) {
|
|||||||
xmlChar *buffer = NULL;
|
xmlChar *buffer = NULL;
|
||||||
xmlChar *out = NULL;
|
xmlChar *out = NULL;
|
||||||
int buffer_size = 0;
|
int buffer_size = 0;
|
||||||
|
#if 0
|
||||||
int html = 0;
|
int html = 0;
|
||||||
|
|
||||||
if (input == NULL) return(NULL);
|
|
||||||
if (doc != NULL)
|
if (doc != NULL)
|
||||||
html = (doc->type == XML_HTML_DOCUMENT_NODE);
|
html = (doc->type == XML_HTML_DOCUMENT_NODE);
|
||||||
|
#endif
|
||||||
|
if (input == NULL) return(NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate an translation buffer.
|
* allocate an translation buffer.
|
||||||
|
@ -797,7 +797,7 @@ xmlTextReaderDoExpand(xmlTextReaderPtr reader) {
|
|||||||
int
|
int
|
||||||
xmlTextReaderRead(xmlTextReaderPtr reader) {
|
xmlTextReaderRead(xmlTextReaderPtr reader) {
|
||||||
int val, olddepth = 0;
|
int val, olddepth = 0;
|
||||||
xmlTextReaderState oldstate = 0;
|
xmlTextReaderState oldstate = XML_TEXTREADER_START;
|
||||||
xmlNodePtr oldnode = NULL;
|
xmlNodePtr oldnode = NULL;
|
||||||
|
|
||||||
if ((reader == NULL) || (reader->ctxt == NULL))
|
if ((reader == NULL) || (reader->ctxt == NULL))
|
||||||
@ -1206,7 +1206,6 @@ xmlTextReaderReadBinHex(xmlTextReaderPtr reader,
|
|||||||
xmlTextReaderPtr
|
xmlTextReaderPtr
|
||||||
xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
|
xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
|
||||||
xmlTextReaderPtr ret;
|
xmlTextReaderPtr ret;
|
||||||
int val;
|
|
||||||
|
|
||||||
if (input == NULL)
|
if (input == NULL)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -1252,7 +1251,7 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
|
|||||||
ret->node = NULL;
|
ret->node = NULL;
|
||||||
ret->curnode = NULL;
|
ret->curnode = NULL;
|
||||||
if (ret->input->buffer->use < 4) {
|
if (ret->input->buffer->use < 4) {
|
||||||
val = xmlParserInputBufferRead(input, 4);
|
xmlParserInputBufferRead(input, 4);
|
||||||
}
|
}
|
||||||
if (ret->input->buffer->use >= 4) {
|
if (ret->input->buffer->use >= 4) {
|
||||||
ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
|
ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
|
||||||
@ -3056,7 +3055,7 @@ xmlTextReaderLocatorBaseURI(xmlTextReaderLocatorPtr locator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xmlTextReaderGenericError(void *ctxt, int severity, char *str) {
|
xmlTextReaderGenericError(void *ctxt, xmlParserSeverities severity, char *str) {
|
||||||
xmlParserCtxtPtr ctx = (xmlParserCtxtPtr)ctxt;
|
xmlParserCtxtPtr ctx = (xmlParserCtxtPtr)ctxt;
|
||||||
xmlTextReaderPtr reader = (xmlTextReaderPtr)ctx->_private;
|
xmlTextReaderPtr reader = (xmlTextReaderPtr)ctx->_private;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user