Commit 6a0baa0c authored by Daniel Veillard's avatar Daniel Veillard

fixed a number of warnings shown by HP-UX compiler and reported by Rick

* HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c
  testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number
  of warnings shown by HP-UX compiler and reported by Rick Jones
Daniel
parent ffe47feb
Sat Dec 10 12:08:28 CET 2005 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c
testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number
of warnings shown by HP-UX compiler and reported by Rick Jones
Fri Dec 9 18:57:31 CET 2005 Rob Richards <rrichards@ctindustries.net>
* xmlwriter.c: Insert space between pubid and sysid when both
......
......@@ -4779,7 +4779,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
}
break;
case XML_PARSER_START_TAG: {
const xmlChar *name, *oldname;
const xmlChar *name;
int failed;
const htmlElemDesc * info;
......@@ -4832,7 +4832,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
SKIP(2);
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, name);
oldname = htmlnamePop(ctxt);
htmlnamePop(ctxt);
ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext,
......@@ -4853,7 +4853,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
*/
if (xmlStrEqual(name, ctxt->name)) {
nodePop(ctxt);
oldname = htmlnamePop(ctxt);
htmlnamePop(ctxt);
}
ctxt->instate = XML_PARSER_CONTENT;
......@@ -4870,7 +4870,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if ((info != NULL) && (info->empty)) {
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, name);
oldname = htmlnamePop(ctxt);
htmlnamePop(ctxt);
}
ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH
......
......@@ -589,7 +589,7 @@ dnl DEC : Enable NaN/Inf
dnl
if test "${GCC}" != "yes" ; then
case "${host}" in
*-*-hpux* )
hppa*-*-hpux* )
CFLAGS="${CFLAGS} -Wp,-H30000"
;;
*-dec-osf* )
......
......@@ -10,8 +10,7 @@
<body bgcolor="#ffffff">
<h1 align="center">The XML C parser and toolkit of Gnome</h1>
<h1>Note: this is the flat content of the <a href="index.html">web
site</a></h1>
<h1>Note: this is the flat content of the <a href="index.html">web site</a></h1>
<h1 style="text-align: center">libxml, a.k.a. gnome-xml</h1>
......
......@@ -1880,7 +1880,7 @@ xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
int found = 0;
if ((seq == NULL) || (node == NULL))
return (-1);
return ((unsigned long) -1);
/* Do a binary search for the key */
lower = 1;
......
......@@ -93,7 +93,6 @@ static int nb_internals = 0;
static int nb_schematas = 0;
static int nb_unimplemented = 0;
static int nb_leaks = 0;
static long libxmlMemoryAllocatedBase = 0;
static int extraMemoryFromResolver = 0;
static int
......@@ -235,7 +234,6 @@ initializeLibxml2(void) {
xmlSchemaInitTypes();
xmlRelaxNGInitTypes();
#endif
libxmlMemoryAllocatedBase = xmlMemUsed();
}
static xmlNodePtr
......@@ -1051,7 +1049,7 @@ done:
int
main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
int res, ret = 0;
int ret = 0;
int old_errors, old_tests, old_leaks;
logfile = fopen(LOGFILE, "w");
......@@ -1069,7 +1067,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
res = xsdTest();
xsdTest();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
......@@ -1080,7 +1078,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
res = rngTest1();
rngTest1();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
......@@ -1091,7 +1089,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_errors = nb_errors;
old_tests = nb_tests;
old_leaks = nb_leaks;
res = rngTest2();
rngTest2();
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests, no errors\n", nb_tests - old_tests);
else
......@@ -1104,8 +1102,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
res = xstcMetadata(
"xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet",
xstcMetadata("xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet",
"xstc/Tests/Metadata/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",
......@@ -1122,8 +1119,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
res = xstcMetadata(
"xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet",
xstcMetadata("xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet",
"xstc/Tests/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",
......@@ -1140,8 +1136,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
old_leaks = nb_leaks;
nb_internals = 0;
nb_schematas = 0;
res = xstcMetadata(
"xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet",
xstcMetadata("xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet",
"xstc/Tests/");
if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
printf("Ran %d tests (%d schemata), no errors\n",
......
......@@ -209,7 +209,6 @@ static void globfree(glob_t *pglob) {
static int nb_tests = 0;
static int nb_errors = 0;
static int nb_leaks = 0;
static long libxmlMemoryAllocatedBase = 0;
static int extraMemoryFromResolver = 0;
static int
......@@ -541,7 +540,6 @@ initializeLibxml2(void) {
xmlSchemaInitTypes();
xmlRelaxNGInitTypes();
#endif
libxmlMemoryAllocatedBase = xmlMemUsed();
}
......
......@@ -283,7 +283,7 @@ static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr
static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return('a');
if (no == 1) return(' ');
if (no == 2) return('');
if (no == 2) return((xmlChar) '');
return(0);
}
......@@ -296,7 +296,7 @@ static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return(0);
if (no == 1) return(1);
if (no == 2) return(122);
return(-1);
return((unsigned int) -1);
}
static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
......@@ -308,7 +308,7 @@ static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return(0);
if (no == 1) return(1);
if (no == 2) return(122);
return(-1);
return((unsigned long) -1);
}
static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
......@@ -2497,7 +2497,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
xmlChar *str = NULL, *msg = NULL;
xmlChar *localName, *nsName;
const xmlChar *cur, *end;
int i, is_not;
int i;
xmlSchemaFormatNodeForError(&msg, actxt, node);
msg = xmlStrcat(msg, (const xmlChar *) message);
......@@ -2520,11 +2520,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
continue;
if ((cur[0] == 'n') && (cur[1] == 'o') && (cur[2] == 't') &&
(cur[3] == ' ')) {
is_not = 1;
cur += 4;
str = xmlStrcat(str, BAD_CAST "##other");
} else {
is_not = 0;
}
/*
* Get the local name.
......@@ -7989,7 +7986,6 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt,
*/
if (nsList != NULL) {
int i, count = 0;
xmlNsPtr ns;
for (i = 0; nsList[i] != NULL; i++)
count++;
......@@ -8003,7 +7999,6 @@ xmlSchemaCheckCSelectorXPath(xmlSchemaParserCtxtPtr ctxt,
return (-1);
}
for (i = 0; i < count; i++) {
ns = nsList[i];
nsArray[2 * i] = nsList[i]->href;
nsArray[2 * i + 1] = nsList[i]->prefix;
}
......@@ -13229,10 +13224,8 @@ xmlSchemaIsDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType)
(type->builtInType == XML_SCHEMAS_ANYTYPE))
return (0);
return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType));
} else
return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType));
return (0);
}
return(xmlSchemaIsDerivedFromBuiltInType(type->subtypes, valType));
}
#if 0
......@@ -13272,11 +13265,8 @@ xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type)
if (WXS_IS_COMPLEX(type))
return (NULL);
if (type->type == XML_SCHEMA_TYPE_BASIC)
return(type);
else
return(xmlSchemaQueryBuiltInType(type->subtypes));
return (NULL);
return(type);
return(xmlSchemaQueryBuiltInType(type->subtypes));
}
/**
......@@ -17776,7 +17766,6 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
break;
}
}
return (0);
}
return (0);
}
......
......@@ -1696,7 +1696,7 @@ xmlSchemaValidateDates (xmlSchemaValType type,
ret = _xmlSchemaParseTimeZone(&(dt->value.date), &cur);
if (collapse)
while IS_WSP_BLANK_CH(*cur) cur++;
if ((ret != 0) || (*cur != 0) || !VALID_DATETIME((&(dt->value.date))))
if ((ret != 0) || (*cur != 0) || (!(VALID_DATETIME((&(dt->value.date))))))
goto error;
......
......@@ -148,7 +148,7 @@ xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
* @str2: the second xmlChar *
*
* Check if both string are equal of have same content
* Should be a bit more readable and faster than xmlStrEqual()
* Should be a bit more readable and faster than xmlStrcmp()
*
* Returns 1 if they are equal, 0 if they are different
*/
......
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