1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

=Bug 118559 (continued)

This commit is contained in:
William M. Brack
2003-08-01 15:55:39 +00:00
parent 78637da0ea
commit 779af00750
9 changed files with 34 additions and 35 deletions

View File

@ -1,3 +1,16 @@
Fri Aug 1 23:55:23 HKT 2003 William Brack <wbrack@mmm.com.hk>
Coninuing work on bug 118559
* DOCBparser.c: removed 2 unsed vars
* xmlregexp.c: changed some numeric const to their enum symbols
* xmlreader.c: changed one var define from int to enum
(a little more to be done, awaiting co-ordination)
* relaxng.c: deleted one unused var
* xmllint.c: deleted some unused vars, changed one arg
val from int to enum
* testHTML.c, testDocbook.c: changed some arg vals to enum const
* xmlIO.c: fixed typo from last night (small warning msg)
Thu Jul 31 22:44:33 HKT 2003 William Brack <wbrack@mmm.com.hk> Thu Jul 31 22:44:33 HKT 2003 William Brack <wbrack@mmm.com.hk>
Working on bug 118559 Working on bug 118559

View File

@ -2675,7 +2675,6 @@ docbParseSGMLAttribute(docbParserCtxtPtr ctxt, const xmlChar stop) {
xmlChar *name = NULL; xmlChar *name = NULL;
xmlChar *cur = NULL; xmlChar *cur = NULL;
xmlEntityPtr xent;
docbEntityDescPtr ent; docbEntityDescPtr ent;
/* /*
@ -2714,7 +2713,7 @@ docbParseSGMLAttribute(docbParserCtxtPtr ctxt, const xmlChar stop) {
*out++ = ((c >> bits) & 0x3F) | 0x80; *out++ = ((c >> bits) & 0x3F) | 0x80;
} }
} else { } else {
xent = docbParseEntityRef(ctxt, &name); docbParseEntityRef(ctxt, &name);
if (name == NULL) { if (name == NULL) {
*out++ = '&'; *out++ = '&';
if (out - buffer > buffer_size - 100) { if (out - buffer > buffer_size - 100) {
@ -3993,10 +3992,9 @@ docbParseReference(docbParserCtxtPtr ctxt) {
/* /*
* we really need to fetch and parse the external entity * we really need to fetch and parse the external entity
*/ */
int parse;
xmlNodePtr children = NULL; xmlNodePtr children = NULL;
parse = docbParseCtxtExternalEntity(ctxt, docbParseCtxtExternalEntity(ctxt,
xent->SystemID, xent->ExternalID, &children); xent->SystemID, xent->ExternalID, &children);
xmlAddChildList((xmlNodePtr) xent, children); xmlAddChildList((xmlNodePtr) xent, children);
} }

View File

@ -8906,7 +8906,7 @@ xmlRelaxNGNodeMatchesList(xmlNodePtr node, xmlRelaxNGDefinePtr *list) {
static int static int
xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt, xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGDefinePtr define) { xmlRelaxNGDefinePtr define) {
int ret = 0, i, nbgroups, left; int ret = 0, i, nbgroups;
int errNr = ctxt->errNr; int errNr = ctxt->errNr;
int oldflags; int oldflags;
@ -8919,7 +8919,6 @@ xmlRelaxNGValidateInterleave(xmlRelaxNGValidCtxtPtr ctxt,
if (define->data != NULL) { if (define->data != NULL) {
partitions = (xmlRelaxNGPartitionPtr) define->data; partitions = (xmlRelaxNGPartitionPtr) define->data;
nbgroups = partitions->nbgroups; nbgroups = partitions->nbgroups;
left = nbgroups;
} else { } else {
VALID_ERR(XML_RELAXNG_ERR_INTERNODATA); VALID_ERR(XML_RELAXNG_ERR_INTERNODATA);
return(-1); return(-1);

View File

@ -643,7 +643,7 @@ parseSAXFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = docbCreatePushParserCtxt(emptySAXHandler, NULL, ctxt = docbCreatePushParserCtxt(emptySAXHandler, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
docbParseChunk(ctxt, chars, res, 0); docbParseChunk(ctxt, chars, res, 0);
} }
@ -669,7 +669,7 @@ parseSAXFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = docbCreatePushParserCtxt(debugSAXHandler, NULL, ctxt = docbCreatePushParserCtxt(debugSAXHandler, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
docbParseChunk(ctxt, chars, res, 0); docbParseChunk(ctxt, chars, res, 0);
} }
@ -725,7 +725,7 @@ parseAndPrintFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = docbCreatePushParserCtxt(NULL, NULL, ctxt = docbCreatePushParserCtxt(NULL, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
docbParseChunk(ctxt, chars, res, 0); docbParseChunk(ctxt, chars, res, 0);
} }

View File

@ -626,7 +626,7 @@ parseSAXFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL, ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0); htmlParseChunk(ctxt, chars, res, 0);
} }
@ -652,7 +652,7 @@ parseSAXFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL, ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0); htmlParseChunk(ctxt, chars, res, 0);
} }
@ -708,7 +708,7 @@ parseAndPrintFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL, ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0); htmlParseChunk(ctxt, chars, res, 0);
} }

View File

@ -737,7 +737,7 @@ xmlFreeZMemBuff( xmlZMemBuffPtr buff ) {
z_err ); z_err );
#else #else
deflateEnd( &buff->zctrl ); deflateEnd( &buff->zctrl );
#endif; #endif
xmlFree( buff ); xmlFree( buff );
return; return;

View File

@ -381,14 +381,12 @@ xmlHTMLError(void *ctx, const char *msg, ...)
{ {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input; xmlParserInputPtr input;
xmlParserInputPtr cur = NULL;
va_list args; va_list args;
int len; int len;
buffer[0] = 0; buffer[0] = 0;
input = ctxt->input; input = ctxt->input;
if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) { if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
cur = input;
input = ctxt->inputTab[ctxt->inputNr - 2]; input = ctxt->inputTab[ctxt->inputNr - 2];
} }
@ -420,14 +418,12 @@ xmlHTMLWarning(void *ctx, const char *msg, ...)
{ {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input; xmlParserInputPtr input;
xmlParserInputPtr cur = NULL;
va_list args; va_list args;
int len; int len;
buffer[0] = 0; buffer[0] = 0;
input = ctxt->input; input = ctxt->input;
if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) { if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
cur = input;
input = ctxt->inputTab[ctxt->inputNr - 2]; input = ctxt->inputTab[ctxt->inputNr - 2];
} }
@ -586,9 +582,6 @@ static void myClose(FILE *f) {
* Stream Test processing * * Stream Test processing *
* * * *
************************************************************************/ ************************************************************************/
static int count = 0;
static int elem, attrs;
static void processNode(xmlTextReaderPtr reader) { static void processNode(xmlTextReaderPtr reader) {
xmlChar *name, *value; xmlChar *name, *value;
@ -617,11 +610,6 @@ static void streamFile(char *filename) {
xmlTextReaderPtr reader; xmlTextReaderPtr reader;
int ret; int ret;
if (count) {
elem = 0;
attrs = 0;
}
reader = xmlNewTextReaderFilename(filename); reader = xmlNewTextReaderFilename(filename);
if (reader != NULL) { if (reader != NULL) {
if (valid) if (valid)
@ -739,7 +727,7 @@ static void parseAndPrintFile(char *filename) {
res = fread(chars, 1, 4, f); res = fread(chars, 1, 4, f);
if (res > 0) { if (res > 0) {
ctxt = docbCreatePushParserCtxt(NULL, NULL, ctxt = docbCreatePushParserCtxt(NULL, NULL,
chars, res, filename, 0); chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) { while ((res = fread(chars, 1, size, f)) > 0) {
docbParseChunk(ctxt, chars, res, 0); docbParseChunk(ctxt, chars, res, 0);
} }

View File

@ -344,7 +344,7 @@ static int
xmlTextReaderPushData(xmlTextReaderPtr reader) { xmlTextReaderPushData(xmlTextReaderPtr reader) {
xmlBufferPtr inbuf; xmlBufferPtr inbuf;
int val, s; int val, s;
int oldstate; xmlTextReaderState oldstate;
if ((reader->input == NULL) || (reader->input->buffer == NULL)) if ((reader->input == NULL) || (reader->input->buffer == NULL))
return(-1); return(-1);

View File

@ -1555,14 +1555,14 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
for (statenr = 0;statenr < ctxt->nbStates;statenr++) { for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
state = ctxt->states[statenr]; state = ctxt->states[statenr];
if (state != NULL) if (state != NULL)
state->reached = 0; state->reached = XML_REGEXP_MARK_NORMAL;
} }
state = ctxt->states[0]; state = ctxt->states[0];
if (state != NULL) if (state != NULL)
state->reached = 1; state->reached = XML_REGEXP_MARK_START;
while (state != NULL) { while (state != NULL) {
xmlRegStatePtr target = NULL; xmlRegStatePtr target = NULL;
state->reached = 2; state->reached = XML_REGEXP_MARK_VISITED;
/* /*
* Mark all state reachable from the current reachable state * Mark all state reachable from the current reachable state
*/ */
@ -1574,8 +1574,8 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
if (ctxt->states[newto] == NULL) if (ctxt->states[newto] == NULL)
continue; continue;
if (ctxt->states[newto]->reached == 0) { if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
ctxt->states[newto]->reached = 1; ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
target = ctxt->states[newto]; target = ctxt->states[newto];
} }
} }
@ -1586,7 +1586,8 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
if (target == NULL) { if (target == NULL) {
for (statenr = 1;statenr < ctxt->nbStates;statenr++) { for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
state = ctxt->states[statenr]; state = ctxt->states[statenr];
if ((state != NULL) && (state->reached == 1)) { if ((state != NULL) && (state->reached ==
XML_REGEXP_MARK_START)) {
target = state; target = state;
break; break;
} }
@ -1596,7 +1597,7 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
} }
for (statenr = 0;statenr < ctxt->nbStates;statenr++) { for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
state = ctxt->states[statenr]; state = ctxt->states[statenr];
if ((state != NULL) && (state->reached == 0)) { if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
#ifdef DEBUG_REGEXP_GRAPH #ifdef DEBUG_REGEXP_GRAPH
printf("Removed unreachable state %d\n", statenr); printf("Removed unreachable state %d\n", statenr);
#endif #endif
@ -3074,7 +3075,7 @@ xmlFAIsChar(xmlRegParserCtxtPtr ctxt) {
static void static void
xmlFAParseCharProp(xmlRegParserCtxtPtr ctxt) { xmlFAParseCharProp(xmlRegParserCtxtPtr ctxt) {
int cur; int cur;
xmlRegAtomType type = 0; xmlRegAtomType type = (xmlRegAtomType) 0;
xmlChar *blockName = NULL; xmlChar *blockName = NULL;
cur = CUR; cur = CUR;