Hello,

  the attached patch fixes all current windows warnings and a few *nix ones.
The pragma shouldn't be necessary in theory but somehow the ms compiler gets
confused but the warning about == can be ignored anyway.

Best regards,
 Marcus
Index: nanoftp.c
===================================================================
RCS file: /cvs/gnome/libxml2/nanoftp.c,v
retrieving revision 1.73
diff -u -p -d -r1.73 nanoftp.c
--- nanoftp.c   6 May 2005 11:40:52 -0000       1.73
+++ nanoftp.c   24 Jul 2005 15:14:46 -0000
@@ -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);
     }
Index: nanohttp.c
===================================================================
RCS file: /cvs/gnome/libxml2/nanohttp.c,v
retrieving revision 1.90
diff -u -p -d -r1.90 nanohttp.c
--- nanohttp.c  12 Jul 2005 15:09:53 -0000      1.90
+++ nanohttp.c  24 Jul 2005 15:14:47 -0000
@@ -462,7 +462,14 @@ xmlNanoHTTPSend(xmlNanoHTTPCtxtPtr ctxt,
                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)
@@ -842,6 +856,10 @@ xmlNanoHTTPConnectAttempt(struct sockadd
     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);
 
@@ -853,6 +871,9 @@ xmlNanoHTTPConnectAttempt(struct sockadd
 #else
     switch(select(s+1, NULL, &wfd, NULL, &tv))
 #endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
     {
        case 0:
            /* Time out */
@@ -1036,7 +1057,7 @@ xmlNanoHTTPConnectHost(const char *host,
                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)) {
Index: xmlregexp.c
===================================================================
RCS file: /cvs/gnome/libxml2/xmlregexp.c,v
retrieving revision 1.49
diff -u -p -d -r1.49 xmlregexp.c
--- xmlregexp.c 19 Jul 2005 16:26:17 -0000      1.49
+++ xmlregexp.c 24 Jul 2005 15:14:48 -0000
@@ -4807,7 +4807,7 @@ xmlAutomataNewNegTrans(xmlAutomataPtr am
 
        atom->valuep = str;
     }
-    snprintf(err_msg, 199, "not %s", atom->valuep);
+    snprintf(err_msg, 199, "not %s", (char*)atom->valuep);
     err_msg[199] = 0;
     atom->valuep2 = xmlStrdup(err_msg);
 
Index: xmlschemastypes.c
===================================================================
RCS file: /cvs/gnome/libxml2/xmlschemastypes.c,v
retrieving revision 1.98
diff -u -p -d -r1.98 xmlschemastypes.c
--- xmlschemastypes.c   14 Jul 2005 15:54:44 -0000      1.98
+++ xmlschemastypes.c   24 Jul 2005 15:14:50 -0000
@@ -2133,7 +2133,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr 
                 unsigned int len, neg = 0;
                xmlChar cval[25];
                xmlChar *cptr = cval;
-               int dec = -1;
+               unsigned int dec = ~0u;
 
                 if (cur == NULL)
                     goto return1;
@@ -2166,7 +2166,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr 
                            *cptr++ = *cur++;
                            len++;
                        } else if (*cur == '.') {
-                           if (dec != -1)
+                           if (dec != ~0u)
                                goto return1;   /* multiple decimal points */
                            cur++;
                            if ((*cur == 0) && (cur -1 == value))
@@ -2193,8 +2193,8 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr 
                        /*
                        * 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--;
@@ -2216,7 +2216,7 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr 
                        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 {
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to