Commit 9e2110bb authored by Daniel Veillard's avatar Daniel Veillard

applied patch from Marcus Boerger to remove warnings on Windows. Daniel

* nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from
  Marcus Boerger to remove warnings on Windows.
Daniel
parent 100e1803
Mon Aug 8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
* nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from
Marcus Boerger to remove warnings on Windows.
Mon Aug 8 16:43:04 CEST 2005 Daniel Veillard <daniel@veillard.com>
* xmlsave.c include/libxml/xmlsave.h: fixed #145092 by adding
......
......@@ -944,7 +944,7 @@ xmlNanoFTPConnect(void *ctx) {
((struct sockaddr_in *)&ctxt->ftpAddr)->sin_family = AF_INET;
memcpy (&((struct sockaddr_in *)&ctxt->ftpAddr)->sin_addr,
hp->h_addr_list[0], hp->h_length);
((struct sockaddr_in *)&ctxt->ftpAddr)->sin_port = htons (port);
((struct sockaddr_in *)&ctxt->ftpAddr)->sin_port = (u_short)htons ((unsigned short)port);
ctxt->controlFd = socket (AF_INET, SOCK_STREAM, 0);
addrlen = sizeof (struct sockaddr_in);
}
......
......@@ -462,7 +462,14 @@ xmlNanoHTTPSend(xmlNanoHTTPCtxtPtr ctxt, const char * xmt_ptr, int outlen) {
tv.tv_sec = timeout;
tv.tv_usec = 0;
FD_ZERO( &wfd );
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4018)
#endif
FD_SET( ctxt->fd, &wfd );
#ifdef _MSC_VER
#pragma warning(pop)
#endif
(void)select( ctxt->fd + 1, NULL, &wfd, NULL, &tv );
}
}
......@@ -555,7 +562,14 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) {
tv.tv_sec = timeout;
tv.tv_usec = 0;
FD_ZERO(&rfd);
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4018)
#endif
FD_SET(ctxt->fd, &rfd);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
if ( (select(ctxt->fd+1, &rfd, NULL, NULL, &tv)<1)
#if defined(EINTR)
......@@ -841,7 +855,11 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
tv.tv_sec = timeout;
tv.tv_usec = 0;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4018)
#endif
FD_ZERO(&wfd);
FD_SET(s, &wfd);
......@@ -852,6 +870,9 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
switch(select(s+1, NULL, &wfd, &xfd, &tv))
#else
switch(select(s+1, NULL, &wfd, NULL, &tv))
#endif
#ifdef _MSC_VER
#pragma warning(pop)
#endif
{
case 0:
......@@ -1036,7 +1057,7 @@ xmlNanoHTTPConnectHost(const char *host, int port)
memcpy (&ia, h->h_addr_list[i], h->h_length);
sockin.sin_family = h->h_addrtype;
sockin.sin_addr = ia;
sockin.sin_port = htons (port);
sockin.sin_port = (u_short)htons ((unsigned short)port);
addr = (struct sockaddr *) &sockin;
#ifdef SUPPORT_IP6
} else if (have_ipv6 () && (h->h_addrtype == AF_INET6)) {
......
......@@ -2251,7 +2251,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
unsigned int len, neg = 0;
xmlChar cval[25];
xmlChar *cptr = cval;
int dec = -1;
unsigned int dec = ~0u;
if (cur == NULL)
goto return1;
......@@ -2284,7 +2284,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
*cptr++ = *cur++;
len++;
} else if (*cur == '.') {
if (dec != -1)
if (dec != ~0u)
goto return1; /* multiple decimal points */
cur++;
if ((*cur == 0) && (cur -1 == value))
......@@ -2311,8 +2311,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
/*
* If a mixed decimal, get rid of trailing zeroes
*/
if (dec != -1) {
while ((len > dec) && (cptr > cval) &&
if (dec != ~0u) {
while ((len > dec) && (cptr > cval) &&
(*(cptr-1) == '0')) {
cptr--;
len--;
......@@ -2334,7 +2334,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
if (len == 0)
len++;
v->value.decimal.sign = neg;
if (dec == -1) {
if (dec == ~0u) {
v->value.decimal.frac = 0;
v->value.decimal.total = len;
} else {
......
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