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.
diff --git a/ChangeLog b/ChangeLog
index d40c40f..227013c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/catalog.c b/catalog.c
index 7ec04a3..df21927 100644
--- a/catalog.c
+++ b/catalog.c
@@ -1973,7 +1973,7 @@
#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:
diff --git a/chvalid.c b/chvalid.c
index cc5b0cd..f6da1b4 100755
--- a/chvalid.c
+++ b/chvalid.c
@@ -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>
*/
diff --git a/genChRanges.py b/genChRanges.py
index f70b1ed..5c4a2b2 100755
--- a/genChRanges.py
+++ b/genChRanges.py
@@ -368,8 +368,12 @@
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)
diff --git a/include/libxml/chvalid.h b/include/libxml/chvalid.h
index a90d41f..505b1a0 100644
--- a/include/libxml/chvalid.h
+++ b/include/libxml/chvalid.h
@@ -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 @@
* Range checking routine
*/
XMLPUBFUN int XMLCALL
- xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr rptr);
+ xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
/**
@@ -64,7 +64,7 @@
((0x61 <= (c)) && ((c) <= 0x7a)) || \
((0xc0 <= (c)) && ((c) <= 0xd6)) || \
((0xd8 <= (c)) && ((c) <= 0xf6)) || \
- ((0xf8 <= (c)) && ((c) <= 0xff)))
+ (0xf8 <= (c)))
/**
* xmlIsBaseCharQ:
@@ -108,7 +108,7 @@
*/
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
((c) == 0xd) || \
- ((0x20 <= (c)) && ((c) <= 0xff)))
+ (0x20 <= (c)))
/**
* xmlIsCharQ:
diff --git a/relaxng.c b/relaxng.c
index 056aaf7..e1def1c 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -7786,7 +7786,7 @@
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 @@
/**
* 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 @@
* 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 @@
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 @@
}
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);
}
diff --git a/testAutomata.c b/testAutomata.c
index 07be2cc..a168a4b 100644
--- a/testAutomata.c
+++ b/testAutomata.c
@@ -29,7 +29,7 @@
static void
testRegexpFile(const char *filename) {
FILE *input;
- char exp[5000];
+ char expr[5000];
int len;
int ret;
int i;
@@ -63,24 +63,24 @@
}
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
"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 @@
} 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);
}
}
}
diff --git a/xpointer.c b/xpointer.c
index e215153..2b96fd3 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -898,7 +898,7 @@
#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)