[Expat-checkins] CVS: expat/lib xmltok.c,1.8,1.9
Fred L. Drake
fdrake@users.sourceforge.net
Thu Apr 25 22:15:02 2002
Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv2166/lib
Modified Files:
xmltok.c
Log Message:
Wrap some long lines, including ones I just introduced.
There ought to be a good way to use a real editor with MSCV!
Index: xmltok.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** xmltok.c 26 Apr 2002 04:46:24 -0000 1.8
--- xmltok.c 26 Apr 2002 05:14:20 -0000 1.9
***************
*** 298,302 ****
break;
case BT_LEAD3:
! *to++ = (unsigned short)(((from[0] & 0xf) << 12) | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
from += 3;
break;
--- 298,303 ----
break;
case BT_LEAD3:
! *to++ = (unsigned short)(((from[0] & 0xf) << 12)
! | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
from += 3;
break;
***************
*** 306,310 ****
if (to + 1 == toLim)
break;
! n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
n -= 0x10000;
to[0] = (unsigned short)((n >> 10) | 0xD800);
--- 307,312 ----
if (to + 1 == toLim)
break;
! n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12)
! | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
n -= 0x10000;
to[0] = (unsigned short)((n >> 10) | 0xD800);
***************
*** 1004,1008 ****
static const char KW_standalone[] = {
! ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, ASCII_n, ASCII_e, '\0'
};
--- 1006,1011 ----
static const char KW_standalone[] = {
! ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o,
! ASCII_n, ASCII_e, '\0'
};
***************
*** 1035,1039 ****
ptr += 5 * enc->minBytesPerChar;
end -= 2 * enc->minBytesPerChar;
! if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) || !name) {
*badPtr = ptr;
return 0;
--- 1038,1043 ----
ptr += 5 * enc->minBytesPerChar;
end -= 2 * enc->minBytesPerChar;
! if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)
! || !name) {
*badPtr = ptr;
return 0;
***************
*** 1080,1084 ****
return 1;
}
! if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) || isGeneralTextEntity) {
*badPtr = name;
return 0;
--- 1084,1089 ----
return 1;
}
! if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone)
! || isGeneralTextEntity) {
*badPtr = name;
return 0;
***************
*** 1233,1237 ****
if (n == 0) {
int c = ((const struct unknown_encoding *)enc)
! ->convert(((const struct unknown_encoding *)enc)->userData, *fromP);
n = XmlUtf8Encode(c, buf);
if (n > toLim - *toP)
--- 1238,1243 ----
if (n == 0) {
int c = ((const struct unknown_encoding *)enc)
! ->convert(((const struct unknown_encoding *)enc)->userData,
! *fromP);
n = XmlUtf8Encode(c, buf);
if (n > toLim - *toP)
***************
*** 1366,1373 ****
static const char KW_ISO_8859_1[] = {
! ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, ASCII_MINUS, ASCII_1, '\0'
};
static const char KW_US_ASCII[] = {
! ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, '\0'
};
static const char KW_UTF_8[] = {
--- 1372,1381 ----
static const char KW_ISO_8859_1[] = {
! ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9,
! ASCII_MINUS, ASCII_1, '\0'
};
static const char KW_US_ASCII[] = {
! ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I,
! '\0'
};
static const char KW_UTF_8[] = {
***************
*** 1378,1385 ****
};
static const char KW_UTF_16BE[] = {
! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, '\0'
};
static const char KW_UTF_16LE[] = {
! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, '\0'
};
--- 1386,1395 ----
};
static const char KW_UTF_16BE[] = {
! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E,
! '\0'
};
static const char KW_UTF_16LE[] = {
! ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E,
! '\0'
};
***************
*** 1404,1418 ****
}
! /* For binary compatibility, we store the index of the encoding specified
! at initialization in the isUtf16 member. */
#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16)
#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i)
! /* This is what detects the encoding.
! encodingTable maps from encoding indices to encodings;
! INIT_ENC_INDEX(enc) is the index of the external (protocol) specified encoding;
! state is XML_CONTENT_STATE if we're parsing an external text entity,
! and XML_PROLOG_STATE otherwise.
*/
--- 1414,1429 ----
}
! /* For binary compatibility, we store the index of the encoding
! specified at initialization in the isUtf16 member.
! */
#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16)
#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i)
! /* This is what detects the encoding. encodingTable maps from
! encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of
! the external (protocol) specified encoding; state is
! XML_CONTENT_STATE if we're parsing an external text entity, and
! XML_PROLOG_STATE otherwise.
*/
***************
*** 1492,1496 ****
if (state == XML_CONTENT_STATE) {
int e = INIT_ENC_INDEX(enc);
! if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC || e == UTF_16LE_ENC || e == UTF_16_ENC)
break;
}
--- 1503,1508 ----
if (state == XML_CONTENT_STATE) {
int e = INIT_ENC_INDEX(enc);
! if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC
! || e == UTF_16LE_ENC || e == UTF_16_ENC)
break;
}
***************
*** 1505,1512 ****
default:
if (ptr[0] == '\0') {
! /* 0 isn't a legal data character. Furthermore a document entity can only
! start with ASCII characters. So the only way this can fail to be big-endian
! UTF-16 if it it's an external parsed general entity that's labelled as
! UTF-16LE. */
if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC)
break;
--- 1517,1526 ----
default:
if (ptr[0] == '\0') {
! /* 0 isn't a legal data character. Furthermore a document
! entity can only start with ASCII characters. So the only
! way this can fail to be big-endian UTF-16 if it it's an
! external parsed general entity that's labelled as
! UTF-16LE.
! */
if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC)
break;