Huge cleanup, I switched to compile with
-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit
-Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat
-Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline
- HTMLparser.[ch] HTMLtree.c SAX.c debugXML.c encoding.[ch]
encoding.h entities.c error.c list.[ch] nanoftp.c
nanohttp.c parser.[ch] parserInternals.[ch] testHTML.c
testSAX.c testURI.c testXPath.c tree.[ch] uri.c
valid.[ch] xinclude.c xmlIO.[ch] xmllint.c xmlmemory.c
xpath.c xpathInternals.h xpointer.[ch] example/gjobread.c:
Cleanup, staticfied a number of non-exported functions,
detected and cleaned up a dozen of problem found this way,
avoided a lot of public function name/typedef/system names clashes
- doc/xml.html: updated
- configure.in: switched private flags to the really pedantic ones.
Daniel
diff --git a/xmllint.c b/xmllint.c
index 332146a..dfe1e69 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -109,7 +109,7 @@
************************************************************************/
char buffer[50000];
-void
+static void
xmlHTMLEncodeSend(void) {
char *result;
@@ -128,7 +128,7 @@
* Displays the associated file and line informations for the current input
*/
-void
+static void
xmlHTMLPrintFileInfo(xmlParserInputPtr input) {
xmlGenericError(xmlGenericErrorContext, "<p>");
if (input != NULL) {
@@ -149,7 +149,7 @@
* Displays current context within the input content for error tracking
*/
-void
+static void
xmlHTMLPrintFileContext(xmlParserInputPtr input) {
const xmlChar *cur, *base;
int n;
@@ -194,7 +194,7 @@
* Display and format an error messages, gives file, line, position and
* extra parameters.
*/
-void
+static void
xmlHTMLError(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
@@ -231,7 +231,7 @@
* Display and format a warning messages, gives file, line, position and
* extra parameters.
*/
-void
+static void
xmlHTMLWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
@@ -269,7 +269,7 @@
* Display and format an validity error messages, gives file,
* line, position and extra parameters.
*/
-void
+static void
xmlHTMLValidityError(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
@@ -303,7 +303,7 @@
* Display and format a validity warning messages, gives file, line,
* position and extra parameters.
*/
-void
+static void
xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
@@ -342,7 +342,7 @@
* Returns a pointer to it or NULL on EOF the caller is expected to
* free the returned string.
*/
-char *
+static char *
xmlShellReadline(char *prompt) {
#ifdef HAVE_LIBREADLINE
char *line_read;
@@ -373,10 +373,10 @@
* *
************************************************************************/
-int myRead(FILE *f, char * buffer, int len) {
- return(fread(buffer, 1, len, f));
+static int myRead(FILE *f, char * buf, int len) {
+ return(fread(buf, 1, len, f));
}
-void myClose(FILE *f) {
+static void myClose(FILE *f) {
if (f != stdin) {
fclose(f);
}
@@ -387,7 +387,7 @@
* Test processing *
* *
************************************************************************/
-void parseAndPrintFile(char *filename) {
+static void parseAndPrintFile(char *filename) {
xmlDocPtr doc = NULL, tmp;
if ((timing) && (!repeat))