Commit 272693c7 authored by William M. Brack's avatar William M. Brack

minor error cleanup for gcc-3.3.[12] compilation warnings.

* catalog.c,relaxng.c,testAutomata.c,xpointer.c,genChRanges.py,
  chvalid.c,include/libxml/chvalid.h,doc/examples/test1.c:
  minor error cleanup for gcc-3.3.[12] compilation warnings.
parent d7cf7f8d
Fri Nov 14 23:47:31 HKT 2003 William Brack <wbrack@mmm.com.hk>
* catalog.c,relaxng.c,testAutomata.c,xpointer.c,genChRanges.py,
chvalid.c,include/libxml/chvalid.h,doc/examples/test1.c:
minor error cleanup for gcc-3.3.[12] compilation warnings.
Fri Nov 14 15:08:13 HKT 2003 William Brack <wbrack@mmm.com.hk>
* tree.c: minor changes to some comments
......
......@@ -1973,7 +1973,7 @@ xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
#define NEXT cur++;
#define SKIP(x) cur += x;
#define SKIP_BLANKS while (IS_BLANK(*cur)) NEXT;
#define SKIP_BLANKS while (IS_BLANK_CH(*cur)) NEXT;
/**
* xmlParseSGMLCatalogComment:
......
......@@ -5,7 +5,7 @@
* This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script
*
* Generation date: Sat Oct 18 20:32:35 2003
* Generation date: Fri Nov 14 23:15:03 2003
* Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk>
*/
......
......@@ -368,8 +368,12 @@ for f in fkeys:
if rg[0] == rg[1]: # single value - check equal
pline += "((c) == 0x%x)" % rg[0]
else: # value range
pline += "((0x%x <= (c)) &&" % rg[0]
pline += " ((c) <= 0x%x))" % rg[1]
# since we are doing char, also change range ending in 0xff
if rg[1] != 0xff:
pline += "((0x%x <= (c)) &&" % rg[0]
pline += " ((c) <= 0x%x))" % rg[1]
else:
pline += " (0x%x <= (c))" % rg[0]
pline += ")\n"
header.write(pline)
......
......@@ -5,7 +5,7 @@
* This file is automatically generated from the cvs source
* definition files using the genChRanges.py Python script
*
* Generation date: Sat Oct 18 20:32:35 2003
* Generation date: Fri Nov 14 23:15:03 2003
* Sources: chvalid.def
* William Brack <wbrack@mmm.com.hk>
*/
......@@ -50,7 +50,7 @@ struct _xmlChRangeGroup {
* Range checking routine
*/
XMLPUBFUN int XMLCALL
xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr rptr);
xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
/**
......@@ -64,7 +64,7 @@ XMLPUBFUN int XMLCALL
((0x61 <= (c)) && ((c) <= 0x7a)) || \
((0xc0 <= (c)) && ((c) <= 0xd6)) || \
((0xd8 <= (c)) && ((c) <= 0xf6)) || \
((0xf8 <= (c)) && ((c) <= 0xff)))
(0xf8 <= (c)))
/**
* xmlIsBaseCharQ:
......@@ -108,7 +108,7 @@ XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup;
*/
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd) || \
((0x20 <= (c)) && ((c) <= 0xff)))
(0x20 <= (c)))
/**
* xmlIsCharQ:
......
......@@ -7786,7 +7786,7 @@ xmlRelaxNGValidateCompiledContent(xmlRelaxNGValidCtxtPtr ctxt,
static int xmlRelaxNGValidateAttributeList(xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGDefinePtr defines);
static int xmlRelaxNGValidateElementEnd(xmlRelaxNGValidCtxtPtr ctxt,
int log);
int dolog);
static void xmlRelaxNGLogBestError(xmlRelaxNGValidCtxtPtr ctxt);
/**
......@@ -9423,7 +9423,7 @@ xmlRelaxNGLogBestError(xmlRelaxNGValidCtxtPtr ctxt)
/**
* xmlRelaxNGValidateElementEnd:
* @ctxt: a Relax-NG validation context
* @log: indicate that error logging should be done
* @dolog: indicate that error logging should be done
*
* Validate the end of the element, implements check that
* there is nothing left not consumed in the element content
......@@ -9432,7 +9432,7 @@ xmlRelaxNGLogBestError(xmlRelaxNGValidCtxtPtr ctxt)
* Returns 0 if the validation succeeded or an error code.
*/
static int
xmlRelaxNGValidateElementEnd(xmlRelaxNGValidCtxtPtr ctxt, int log)
xmlRelaxNGValidateElementEnd(xmlRelaxNGValidCtxtPtr ctxt, int dolog)
{
int i;
xmlRelaxNGValidStatePtr state;
......@@ -9441,7 +9441,7 @@ xmlRelaxNGValidateElementEnd(xmlRelaxNGValidCtxtPtr ctxt, int log)
if (state->seq != NULL) {
state->seq = xmlRelaxNGSkipIgnored(ctxt, state->seq);
if (state->seq != NULL) {
if (log) {
if (dolog) {
VALID_ERR3(XML_RELAXNG_ERR_EXTRACONTENT,
state->node->name, state->seq->name);
}
......@@ -9450,7 +9450,7 @@ xmlRelaxNGValidateElementEnd(xmlRelaxNGValidCtxtPtr ctxt, int log)
}
for (i = 0; i < state->nbAttrs; i++) {
if (state->attrs[i] != NULL) {
if (log) {
if (dolog) {
VALID_ERR3(XML_RELAXNG_ERR_INVALIDATTR,
state->attrs[i]->name, state->node->name);
}
......
......@@ -29,7 +29,7 @@ static int scanNumber(char **ptr) {
static void
testRegexpFile(const char *filename) {
FILE *input;
char exp[5000];
char expr[5000];
int len;
int ret;
int i;
......@@ -63,24 +63,24 @@ testRegexpFile(const char *filename) {
}
ret = 0;
while (fgets(exp, 4500, input) != NULL) {
if (exp[0] == '#')
while (fgets(expr, 4500, input) != NULL) {
if (expr[0] == '#')
continue;
len = strlen(exp);
len = strlen(expr);
len--;
while ((len >= 0) &&
((exp[len] == '\n') || (exp[len] == '\t') ||
(exp[len] == '\r') || (exp[len] == ' '))) len--;
exp[len + 1] = 0;
((expr[len] == '\n') || (expr[len] == '\t') ||
(expr[len] == '\r') || (expr[len] == ' '))) len--;
expr[len + 1] = 0;
if (len >= 0) {
if ((am != NULL) && (exp[0] == 't') && (exp[1] == ' ')) {
char *ptr = &exp[2];
if ((am != NULL) && (expr[0] == 't') && (expr[1] == ' ')) {
char *ptr = &expr[2];
int from, to;
from = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
if (states[from] == NULL)
......@@ -89,7 +89,7 @@ testRegexpFile(const char *filename) {
to = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
if (states[to] == NULL)
......@@ -97,14 +97,14 @@ testRegexpFile(const char *filename) {
ptr++;
xmlAutomataNewTransition(am, states[from], states[to],
BAD_CAST ptr, NULL);
} else if ((am != NULL) && (exp[0] == 'e') && (exp[1] == ' ')) {
char *ptr = &exp[2];
} else if ((am != NULL) && (expr[0] == 'e') && (expr[1] == ' ')) {
char *ptr = &expr[2];
int from, to;
from = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
if (states[from] == NULL)
......@@ -114,26 +114,26 @@ testRegexpFile(const char *filename) {
if (states[to] == NULL)
states[to] = xmlAutomataNewState(am);
xmlAutomataNewEpsilon(am, states[from], states[to]);
} else if ((am != NULL) && (exp[0] == 'f') && (exp[1] == ' ')) {
char *ptr = &exp[2];
} else if ((am != NULL) && (expr[0] == 'f') && (expr[1] == ' ')) {
char *ptr = &expr[2];
int state;
state = scanNumber(&ptr);
if (states[state] == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Bad state %d : %s\n", state, exp);
"Bad state %d : %s\n", state, expr);
break;
}
xmlAutomataSetFinalState(am, states[state]);
} else if ((am != NULL) && (exp[0] == 'c') && (exp[1] == ' ')) {
char *ptr = &exp[2];
} else if ((am != NULL) && (expr[0] == 'c') && (expr[1] == ' ')) {
char *ptr = &expr[2];
int from, to;
int min, max;
from = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
if (states[from] == NULL)
......@@ -142,7 +142,7 @@ testRegexpFile(const char *filename) {
to = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
if (states[to] == NULL)
......@@ -151,20 +151,20 @@ testRegexpFile(const char *filename) {
min = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
ptr++;
max = scanNumber(&ptr);
if (*ptr != ' ') {
xmlGenericError(xmlGenericErrorContext,
"Bad line %s\n", exp);
"Bad line %s\n", expr);
break;
}
ptr++;
xmlAutomataNewCountTrans(am, states[from], states[to],
BAD_CAST ptr, min, max, NULL);
} else if ((am != NULL) && (exp[0] == '-') && (exp[1] == '-')) {
} else if ((am != NULL) && (expr[0] == '-') && (expr[1] == '-')) {
/* end of the automata */
regexp = xmlAutomataCompile(am);
xmlFreeAutomata(am);
......@@ -174,7 +174,7 @@ testRegexpFile(const char *filename) {
"Failed to compile the automata");
break;
}
} else if ((exp[0] == '=') && (exp[1] == '>')) {
} else if ((expr[0] == '=') && (expr[1] == '>')) {
if (regexp == NULL) {
printf("=> failed not compiled\n");
} else {
......@@ -196,10 +196,10 @@ testRegexpFile(const char *filename) {
} else if (regexp != NULL) {
if (exec == NULL)
exec = xmlRegNewExecCtxt(regexp, NULL, NULL);
ret = xmlRegExecPushString(exec, BAD_CAST exp, NULL);
ret = xmlRegExecPushString(exec, BAD_CAST expr, NULL);
} else {
xmlGenericError(xmlGenericErrorContext,
"Unexpected line %s\n", exp);
"Unexpected line %s\n", expr);
}
}
}
......
......@@ -898,7 +898,7 @@ static void xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name);
#define CUR_PTR ctxt->cur
#define SKIP_BLANKS \
while (IS_BLANK(*(ctxt->cur))) NEXT
while (IS_BLANK_CH(*(ctxt->cur))) NEXT
#define CURRENT (*ctxt->cur)
#define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment