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/encoding.c b/encoding.c
index fab241e..41f2325 100644
--- a/encoding.c
+++ b/encoding.c
@@ -91,7 +91,7 @@
* Returns the char value or -1 in case of error and update @len with the
* number of bytes used
*/
-int
+static int
xmlGetUTF8Char(const unsigned char *utf, int *len) {
unsigned int c;
@@ -206,7 +206,7 @@
* as the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of ocetes consumed.
*/
-int
+static int
asciiToUTF8(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen) {
unsigned char* outstart = out;
@@ -258,7 +258,7 @@
* as the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of ocetes consumed.
*/
-int
+static int
UTF8Toascii(unsigned char* out, int *outlen,
const unsigned char* in, int *inlen) {
const unsigned char* processed = in;
@@ -478,7 +478,7 @@
* The value of *inlen after return is the number of octets consumed
* as the return value is positive, else unpredictiable.
*/
-int
+static int
UTF16LEToUTF8(unsigned char* out, int *outlen,
const unsigned char* inb, int *inlenb)
{
@@ -562,7 +562,7 @@
* Returns the number of byte written, or -1 by lack of space, or -2
* if the transcoding failed.
*/
-int
+static int
UTF8ToUTF16LE(unsigned char* outb, int *outlen,
const unsigned char* in, int *inlen)
{
@@ -685,7 +685,7 @@
* The value of *inlen after return is the number of octets consumed
* as the return value is positive, else unpredictiable.
*/
-int
+static int
UTF16BEToUTF8(unsigned char* out, int *outlen,
const unsigned char* inb, int *inlenb)
{
@@ -773,7 +773,7 @@
* Returns the number of byte written, or -1 by lack of space, or -2
* if the transcoding failed.
*/
-int
+static int
UTF8ToUTF16BE(unsigned char* outb, int *outlen,
const unsigned char* in, int *inlen)
{
@@ -1247,7 +1247,7 @@
* Create and registers an xmlCharEncodingHandler.
* Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
*/
-xmlCharEncodingHandlerPtr
+static xmlCharEncodingHandlerPtr
xmlNewCharEncodingHandler(const char *name,
xmlCharEncodingInputFunc input,
xmlCharEncodingOutputFunc output) {
@@ -1662,9 +1662,7 @@
char *icv_out = (char *) out;
int ret;
- ret = iconv(cd,
- &icv_in, &icv_inlen,
- &icv_out, &icv_outlen);
+ ret = iconv(cd, &icv_in, &icv_inlen, &icv_out, &icv_outlen);
if (in != NULL) {
*inlen -= icv_inlen;
*outlen -= icv_outlen;
@@ -1672,7 +1670,7 @@
*inlen = 0;
*outlen = 0;
}
- if (icv_inlen != 0 || ret == (size_t) -1) {
+ if ((icv_inlen != 0) || (ret == -1)) {
#ifdef EILSEQ
if (errno == EILSEQ) {
return -2;