[Expat-checkins] CVS: expat/lib xmlparse.c,1.30,1.31 xmltok.c,1.7,1.8

Fred L. Drake fdrake@users.sourceforge.net
Thu Apr 25 21:47:05 2002


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv29880

Modified Files:
	xmlparse.c xmltok.c 
Log Message:
Cut down on the warnings from MSVC6 on Warning Level 4.

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** xmlparse.c	24 Apr 2002 03:36:23 -0000	1.30
--- xmlparse.c	26 Apr 2002 04:46:24 -0000	1.31
***************
*** 3831,3835 ****
    att->id = attId;
    att->value = value;
!   att->isCdata = isCdata;
    if (!isCdata)
      attId->maybeTokenized = 1;
--- 3831,3835 ----
    att->id = attId;
    att->value = value;
!   att->isCdata = (char)isCdata;
    if (!isCdata)
      attId->maybeTokenized = 1;

Index: xmltok.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** xmltok.c	25 Jul 2001 17:18:43 -0000	1.7
--- xmltok.c	26 Apr 2002 04:46:24 -0000	1.8
***************
*** 294,302 ****
      switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
      case BT_LEAD2:
!       *to++ = ((from[0] & 0x1f) << 6) | (from[1] & 0x3f);
        from += 2;
        break;
      case BT_LEAD3:
!       *to++ = ((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f);
        from += 3;
        break;
--- 294,302 ----
      switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
      case BT_LEAD2:
!       *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
        from += 2;
        break;
      case BT_LEAD3:
!       *to++ = (unsigned short)(((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
        from += 3;
        break;
***************
*** 382,387 ****
        if (toLim - *toP < 2)
  	break;
!       *(*toP)++ = ((c >> 6) | UTF8_cval2);
!       *(*toP)++ = ((c & 0x3f) | 0x80);
        (*fromP)++;
      }
--- 382,387 ----
        if (toLim - *toP < 2)
  	break;
!       *(*toP)++ = (char)((c >> 6) | UTF8_cval2);
!       *(*toP)++ = (char)((c & 0x3f) | 0x80);
        (*fromP)++;
      }
***************
*** 974,978 ****
      return 0;
    }
!   open = c;
    ptr += enc->minBytesPerChar;
    *valPtr = ptr;
--- 974,978 ----
      return 0;
    }
!   open = (char)c;
    ptr += enc->minBytesPerChar;
    *valPtr = ptr;
***************
*** 1136,1158 ****
      return 0;
    if (c < min2) {
!     buf[0] = (c | UTF8_cval1);
      return 1;
    }
    if (c < min3) {
!     buf[0] = ((c >> 6) | UTF8_cval2);
!     buf[1] = ((c & 0x3f) | 0x80);
      return 2;
    }
    if (c < min4) {
!     buf[0] = ((c >> 12) | UTF8_cval3);
!     buf[1] = (((c >> 6) & 0x3f) | 0x80);
!     buf[2] = ((c & 0x3f) | 0x80);
      return 3;
    }
    if (c < 0x110000) {
!     buf[0] = ((c >> 18) | UTF8_cval4);
!     buf[1] = (((c >> 12) & 0x3f) | 0x80);
!     buf[2] = (((c >> 6) & 0x3f) | 0x80);
!     buf[3] = ((c & 0x3f) | 0x80);
      return 4;
    }
--- 1136,1158 ----
      return 0;
    if (c < min2) {
!     buf[0] = (char)(c | UTF8_cval1);
      return 1;
    }
    if (c < min3) {
!     buf[0] = (char)((c >> 6) | UTF8_cval2);
!     buf[1] = (char)((c & 0x3f) | 0x80);
      return 2;
    }
    if (c < min4) {
!     buf[0] = (char)((c >> 12) | UTF8_cval3);
!     buf[1] = (char)(((c >> 6) & 0x3f) | 0x80);
!     buf[2] = (char)((c & 0x3f) | 0x80);
      return 3;
    }
    if (c < 0x110000) {
!     buf[0] = (char)((c >> 18) | UTF8_cval4);
!     buf[1] = (char)(((c >> 12) & 0x3f) | 0x80);
!     buf[2] = (char)(((c >> 6) & 0x3f) | 0x80);
!     buf[3] = (char)((c & 0x3f) | 0x80);
      return 4;
    }
***************
*** 1165,1175 ****
      return 0;
    if (charNum < 0x10000) {
!     buf[0] = charNum;
      return 1;
    }
    if (charNum < 0x110000) {
      charNum -= 0x10000;
!     buf[0] = (charNum >> 10) + 0xD800;
!     buf[1] = (charNum & 0x3FF) + 0xDC00;
      return 2;
    }
--- 1165,1175 ----
      return 0;
    if (charNum < 0x10000) {
!     buf[0] = (unsigned short)charNum;
      return 1;
    }
    if (charNum < 0x110000) {
      charNum -= 0x10000;
!     buf[0] = (unsigned short)((charNum >> 10) + 0xD800);
!     buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00);
      return 2;
    }
***************
*** 1299,1303 ****
        if (c < -4)
  	return 0;
!       e->normal.type[i] = BT_LEAD2 - (c + 2);
        e->utf8[i][0] = 0;
        e->utf16[i] = 0;
--- 1299,1303 ----
        if (c < -4)
  	return 0;
!       e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2));
        e->utf8[i][0] = 0;
        e->utf16[i] = 0;
***************
*** 1311,1315 ****
        e->utf8[i][0] = 1;
        e->utf8[i][1] = (char)c;
!       e->utf16[i] = c == 0 ? 0xFFFF : c;
      }
      else if (checkCharRefNumber(c) < 0) {
--- 1311,1315 ----
        e->utf8[i][0] = 1;
        e->utf8[i][1] = (char)c;
!       e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c);
      }
      else if (checkCharRefNumber(c) < 0) {
***************
*** 1330,1334 ****
  	e->normal.type[i] = BT_OTHER;
        e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1);
!       e->utf16[i] = c;
      }
    }
--- 1330,1334 ----
  	e->normal.type[i] = BT_OTHER;
        e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1);
!       e->utf16[i] = (unsigned short)c;
      }
    }