Hello List,

  this is a reminder to not forget this minor issue. 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

###################

Message from Rob to me:

About to head out but wanted to get this off to you. The patch seemed 
fine and didnt fail the regression tests.
I attatched a new patch against latest cvs as the other wouldnt merge 
right with all the changes.

Anyways, I would suggest you re-send to list as patches often get lost.

Later!

Rob
Index: xmlschemastypes.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xmlschemastypes.c,v
retrieving revision 1.99
diff -c -r1.99 xmlschemastypes.c
*** xmlschemastypes.c   28 Jul 2005 00:50:21 -0000      1.99
--- xmlschemastypes.c   8 Aug 2005 11:27:17 -0000
***************
*** 2251,2257 ****
                  unsigned int len, neg = 0;
                xmlChar cval[25];
                xmlChar *cptr = cval;
!               int dec = -1;
  
                  if (cur == NULL)
                      goto return1;
--- 2251,2257 ----
                  unsigned int len, neg = 0;
                xmlChar cval[25];
                xmlChar *cptr = cval;
!               unsigned int dec = ~0u;
  
                  if (cur == NULL)
                      goto return1;
***************
*** 2284,2290 ****
                            *cptr++ = *cur++;
                            len++;
                        } else if (*cur == '.') {
!                           if (dec != -1)
                                goto return1;   /* multiple decimal points */
                            cur++;
                            if ((*cur == 0) && (cur -1 == value))
--- 2284,2290 ----
                            *cptr++ = *cur++;
                            len++;
                        } else if (*cur == '.') {
!                           if (dec != ~0u)
                                goto return1;   /* multiple decimal points */
                            cur++;
                            if ((*cur == 0) && (cur -1 == value))
***************
*** 2311,2318 ****
                        /*
                        * If a mixed decimal, get rid of trailing zeroes
                        */
!                       if (dec != -1) {
!                           while ((len > dec) && (cptr > cval) &&

                                (*(cptr-1) == '0')) {
                                cptr--;
                                len--;
--- 2311,2319 ----
                        /*
                        * If a mixed decimal, get rid of trailing zeroes
                        */
!                       if (dec != ~0u) {
!                           while ((len > dec) && (cptr > cval) &&
! 
                                (*(cptr-1) == '0')) {
                                cptr--;
                                len--;
***************
*** 2334,2340 ****
                        if (len == 0)
                            len++;
                          v->value.decimal.sign = neg;
!                       if (dec == -1) {
                            v->value.decimal.frac = 0;
                            v->value.decimal.total = len;
                        } else {
--- 2335,2341 ----
                        if (len == 0)
                            len++;
                          v->value.decimal.sign = neg;
!                       if (dec == ~0u) {
                            v->value.decimal.frac = 0;
                            v->value.decimal.total = len;
                        } else {
Index: nanohttp.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/nanohttp.c,v
retrieving revision 1.91
diff -c -r1.91 nanohttp.c
*** nanohttp.c  7 Aug 2005 10:46:18 -0000       1.91
--- nanohttp.c  8 Aug 2005 11:27:18 -0000
***************
*** 462,468 ****
--- 462,475 ----
                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,561 ****
--- 562,575 ----
        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,847 ****
      
      tv.tv_sec = timeout;
      tv.tv_usec = 0;
!     
      FD_ZERO(&wfd);
      FD_SET(s, &wfd);
  
--- 855,865 ----
      
      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,858 ****
--- 871,879 ----
  #else
      switch(select(s+1, NULL, &wfd, NULL, &tv))
  #endif
+ #ifdef _MSC_VER
+ #pragma warning(pop)
+ #endif
      {
        case 0:
            /* Time out */
***************
*** 1036,1042 ****
                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);
                addr = (struct sockaddr *) &sockin;
  #ifdef SUPPORT_IP6
            } else if (have_ipv6 () && (h->h_addrtype == AF_INET6)) {
--- 1057,1063 ----
                memcpy (&ia, h->h_addr_list[i], h->h_length);
                sockin.sin_family = h->h_addrtype;
                sockin.sin_addr = ia;
!               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: nanoftp.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/nanoftp.c,v
retrieving revision 1.74
diff -c -r1.74 nanoftp.c
*** nanoftp.c   7 Aug 2005 10:46:18 -0000       1.74
--- nanoftp.c   8 Aug 2005 11:27:19 -0000
***************
*** 944,950 ****
        ((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);
        ctxt->controlFd = socket (AF_INET, SOCK_STREAM, 0);
        addrlen = sizeof (struct sockaddr_in);
      }
--- 944,950 ----
        ((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 = (u_short)htons 
((unsigned short)port);
        ctxt->controlFd = socket (AF_INET, SOCK_STREAM, 0);
        addrlen = sizeof (struct sockaddr_in);
      }
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to