=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>
Working on bug 118559

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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