[xml] Some compiler warnings and fixes



Some minor compiler warnings I encountered while trying to
compile libxml2-2.4.11 on Windows with Microsoft Visual C++:

h:\tofu\src\libxml\nanoftp.c(890) : warning C4761: integral size mismatch in argument; conversion supplied
h:\tofu\src\libxml\nanohttp.c(896) : warning C4761: integral size mismatch in argument; conversion supplied

h:\tofu\src\libxml\tree.c(2894) : warning C4028: formal parameter 1 different from declaration
h:\tofu\src\libxml\tree.c(2909) : warning C4028: formal parameter 1 different from declaration

And on Linux I ran into

gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -I/include -g -O2 -Wall
-c xmlmemory.c   -fPIC -DPIC -o .libs/xmlmemory.lo
xmlmemory.c:629: warning: `xmlMemoryDumpFile' defined but not used

On Solaris:
cc1: warnings being treated as errors
encoding.c: In function `xmlIconvWrapper':
encoding.c:1903: warning: passing arg 2 of `iconv' from incompatible pointer type

I've fixed these problems in the version we are using with these
diffs:

./include/libxml/tree.h
637c637
< xmlNodePtr    xmlDocCopyNode          (const xmlNodePtr node,
---
xmlNodePtr    xmlDocCopyNode          (xmlNodePtr node,
640c640
< xmlNodePtr    xmlCopyNodeList         (const xmlNodePtr node);
---
xmlNodePtr    xmlCopyNodeList         (xmlNodePtr node);

./encoding.c
1903c1903
<     ret = iconv(cd, (const char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
---
    ret = iconv(cd, (char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);

./nanoftp.c
890c890
<     ctxt->ftpAddr.sin_port = htons((unsigned short)port);
---
    ctxt->ftpAddr.sin_port = htons(port);

./nanohttp.c
896c896
<           sockin.sin_port   = htons((unsigned short)port);
---
          sockin.sin_port   = htons(port);






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]