[Expat-checkins] expat/lib xmltok_ns.c,1.5,1.6 xmltok_impl.c,1.8,1.9
xmltok.h,1.6,1.7 xmltok.c,1.24,1.25 xmlrole.h,1.9,1.10
xmlrole.c,1.13,1.14 xmlparse.c,1.86,1.87 internal.h,1.3,1.4
Karl Waclawek
kwaclaw@users.sourceforge.net
Thu, 19 Sep 2002 20:42:45 -0700
Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv30574
Modified Files:
xmltok_ns.c xmltok_impl.c xmltok.h xmltok.c xmlrole.h
xmlrole.c xmlparse.c internal.h
Log Message:
Changed calling convention macros to differentiate between
different types of function calls - see comments in internal.h.
Index: xmltok_ns.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok_ns.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xmltok_ns.c 5 Sep 2002 18:21:01 -0000 1.5
+++ xmltok_ns.c 20 Sep 2002 03:42:43 -0000 1.6
@@ -29,7 +29,7 @@
&ns(utf8_encoding).enc /* NO_ENC */
};
-static int FASTCALL
+static int PTRCALL
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -37,7 +37,7 @@
XML_PROLOG_STATE, ptr, end, nextTokPtr);
}
-static int FASTCALL
+static int PTRCALL
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
Index: xmltok_impl.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok_impl.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- xmltok_impl.c 5 Sep 2002 18:21:01 -0000 1.8
+++ xmltok_impl.c 20 Sep 2002 03:42:43 -0000 1.9
@@ -86,7 +86,7 @@
/* ptr points to character following "<!-" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanComment)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -124,7 +124,7 @@
/* ptr points to character following "<!" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanDecl)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -171,7 +171,7 @@
return XML_TOK_PARTIAL;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr,
const char *end, int *tokPtr)
{
@@ -216,7 +216,7 @@
/* ptr points to character following "<?" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -278,7 +278,7 @@
return XML_TOK_PARTIAL;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -298,7 +298,7 @@
return XML_TOK_CDATA_SECT_OPEN;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -376,7 +376,7 @@
/* ptr points to character following "</" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -425,7 +425,7 @@
/* ptr points to character following "&#X" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -457,7 +457,7 @@
/* ptr points to character following "&#" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -489,7 +489,7 @@
/* ptr points to character following "&" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -519,7 +519,7 @@
/* ptr points to character following first character of attribute name */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -678,7 +678,7 @@
/* ptr points to character following "<" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -778,7 +778,7 @@
return XML_TOK_PARTIAL;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -877,7 +877,7 @@
/* ptr points to character following "%" */
-static int FASTCALL
+static int PTRCALL
PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -906,7 +906,7 @@
return XML_TOK_PARTIAL;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -933,7 +933,7 @@
return -XML_TOK_POUND_NAME;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(scanLit)(int open, const ENCODING *enc,
const char *ptr, const char *end,
const char **nextTokPtr)
@@ -965,7 +965,7 @@
return XML_TOK_PARTIAL;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
@@ -1196,7 +1196,7 @@
return -tok;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -1254,7 +1254,7 @@
return XML_TOK_DATA_CHARS;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -1311,7 +1311,7 @@
#ifdef XML_DTD
-static int FASTCALL
+static int PTRCALL
PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr,
const char *end, const char **nextTokPtr)
{
@@ -1364,7 +1364,7 @@
#endif /* XML_DTD */
-static int FASTCALL
+static int PTRCALL
PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
const char **badPtr)
{
@@ -1424,7 +1424,7 @@
first attsMax attributes are stored in atts.
*/
-static int FASTCALL
+static int PTRCALL
PREFIX(getAtts)(const ENCODING *enc, const char *ptr,
int attsMax, ATTRIBUTE *atts)
{
@@ -1517,7 +1517,7 @@
/* not reached */
}
-static int FASTCALL
+static int PTRFASTCALL
PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr)
{
int result = 0;
@@ -1561,7 +1561,7 @@
return checkCharRefNumber(result);
}
-static int FASTCALL
+static int PTRCALL
PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr,
const char *end)
{
@@ -1615,7 +1615,7 @@
return 0;
}
-static int FASTCALL
+static int PTRCALL
PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
{
for (;;) {
@@ -1679,7 +1679,7 @@
/* not reached */
}
-static int FASTCALL
+static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1,
const char *end1, const char *ptr2)
{
@@ -1692,7 +1692,7 @@
return ptr1 == end1;
}
-static int FASTCALL
+static int PTRFASTCALL
PREFIX(nameLength)(const ENCODING *enc, const char *ptr)
{
const char *start = ptr;
@@ -1719,7 +1719,7 @@
}
}
-static const char * FASTCALL
+static const char * PTRFASTCALL
PREFIX(skipS)(const ENCODING *enc, const char *ptr)
{
for (;;) {
@@ -1735,7 +1735,7 @@
}
}
-static void FASTCALL
+static void PTRCALL
PREFIX(updatePosition)(const ENCODING *enc,
const char *ptr,
const char *end,
@@ -1776,3 +1776,4 @@
#undef CHECK_NAME_CASES
#undef CHECK_NMSTRT_CASE
#undef CHECK_NMSTRT_CASES
+
Index: xmltok.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xmltok.h 5 Sep 2002 18:21:01 -0000 1.6
+++ xmltok.h 20 Sep 2002 03:42:43 -0000 1.7
@@ -125,49 +125,49 @@
struct encoding;
typedef struct encoding ENCODING;
-typedef int (FASTCALL *SCANNER)(const ENCODING *,
- const char *,
- const char *,
- const char **);
+typedef int (PTRCALL *SCANNER)(const ENCODING *,
+ const char *,
+ const char *,
+ const char **);
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
- int (FASTCALL *sameName)(const ENCODING *,
- const char *,
- const char *);
- int (FASTCALL *nameMatchesAscii)(const ENCODING *,
- const char *,
- const char *,
- const char *);
- int (FASTCALL *nameLength)(const ENCODING *, const char *);
- const char *(FASTCALL *skipS)(const ENCODING *, const char *);
- int (FASTCALL *getAtts)(const ENCODING *enc,
- const char *ptr,
- int attsMax,
- ATTRIBUTE *atts);
- int (FASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
- int (FASTCALL *predefinedEntityName)(const ENCODING *,
- const char *,
- const char *);
- void (FASTCALL *updatePosition)(const ENCODING *,
- const char *ptr,
- const char *end,
- POSITION *);
- int (FASTCALL *isPublicId)(const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr);
- void (FASTCALL *utf8Convert)(const ENCODING *enc,
+ int (PTRCALL *sameName)(const ENCODING *,
+ const char *,
+ const char *);
+ int (PTRCALL *nameMatchesAscii)(const ENCODING *,
+ const char *,
+ const char *,
+ const char *);
+ int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
+ const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
+ int (PTRCALL *getAtts)(const ENCODING *enc,
+ const char *ptr,
+ int attsMax,
+ ATTRIBUTE *atts);
+ int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
+ int (PTRCALL *predefinedEntityName)(const ENCODING *,
+ const char *,
+ const char *);
+ void (PTRCALL *updatePosition)(const ENCODING *,
+ const char *ptr,
+ const char *end,
+ POSITION *);
+ int (PTRCALL *isPublicId)(const ENCODING *enc,
+ const char *ptr,
+ const char *end,
+ const char **badPtr);
+ void (PTRCALL *utf8Convert)(const ENCODING *enc,
+ const char **fromP,
+ const char *fromLim,
+ char **toP,
+ const char *toLim);
+ void (PTRCALL *utf16Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
- char **toP,
- const char *toLim);
- void (FASTCALL *utf16Convert)(const ENCODING *enc,
- const char **fromP,
- const char *fromLim,
- unsigned short **toP,
- const unsigned short *toLim);
+ unsigned short **toP,
+ const unsigned short *toLim);
int minBytesPerChar;
char isUtf8;
char isUtf16;
@@ -263,44 +263,42 @@
const ENCODING **encPtr;
} INIT_ENCODING;
-int XmlParseXmlDecl(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingNamePtr,
- const ENCODING **namedEncodingPtr,
- int *standalonePtr);
-
-int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
-const ENCODING *XmlGetUtf8InternalEncoding(void);
-const ENCODING *XmlGetUtf16InternalEncoding(void);
-int XmlUtf8Encode(int charNumber, char *buf);
-int XmlUtf16Encode(int charNumber, unsigned short *buf);
-
-int XmlSizeOfUnknownEncoding(void);
-ENCODING *
+int XmlParseXmlDecl(int isGeneralTextEntity,
+ const ENCODING *enc,
+ const char *ptr,
+ const char *end,
+ const char **badPtr,
+ const char **versionPtr,
+ const char **versionEndPtr,
+ const char **encodingNamePtr,
+ const ENCODING **namedEncodingPtr,
+ int *standalonePtr);
+int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
+const ENCODING *XmlGetUtf8InternalEncoding(void);
+const ENCODING *XmlGetUtf16InternalEncoding(void);
+int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
+int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
+int XmlSizeOfUnknownEncoding(void);
+ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
int (*conv)(void *userData, const char *p),
void *userData);
-int XmlParseXmlDeclNS(int isGeneralTextEntity,
- const ENCODING *enc,
- const char *ptr,
- const char *end,
- const char **badPtr,
- const char **versionPtr,
- const char **versionEndPtr,
- const char **encodingNamePtr,
- const ENCODING **namedEncodingPtr,
- int *standalonePtr);
-int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
-const ENCODING *XmlGetUtf8InternalEncodingNS(void);
-const ENCODING *XmlGetUtf16InternalEncodingNS(void);
-ENCODING *
+int XmlParseXmlDeclNS(int isGeneralTextEntity,
+ const ENCODING *enc,
+ const char *ptr,
+ const char *end,
+ const char **badPtr,
+ const char **versionPtr,
+ const char **versionEndPtr,
+ const char **encodingNamePtr,
+ const ENCODING **namedEncodingPtr,
+ int *standalonePtr);
+int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
+const ENCODING *XmlGetUtf8InternalEncodingNS(void);
+const ENCODING *XmlGetUtf16InternalEncodingNS(void);
+ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
int (*conv)(void *userData, const char *p),
Index: xmltok.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- xmltok.c 5 Sep 2002 18:21:01 -0000 1.24
+++ xmltok.c 20 Sep 2002 03:42:43 -0000 1.25
@@ -112,19 +112,19 @@
|| \
((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0)))
-static int FASTCALL
+static int PTRFASTCALL
isNever(const ENCODING *enc, const char *p)
{
return 0;
}
-static int FASTCALL
+static int PTRFASTCALL
utf8_isName2(const ENCODING *enc, const char *p)
{
return UTF8_GET_NAMING2(namePages, (const unsigned char *)p);
}
-static int FASTCALL
+static int PTRFASTCALL
utf8_isName3(const ENCODING *enc, const char *p)
{
return UTF8_GET_NAMING3(namePages, (const unsigned char *)p);
@@ -132,13 +132,13 @@
#define utf8_isName4 isNever
-static int FASTCALL
+static int PTRFASTCALL
utf8_isNmstrt2(const ENCODING *enc, const char *p)
{
return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p);
}
-static int FASTCALL
+static int PTRFASTCALL
utf8_isNmstrt3(const ENCODING *enc, const char *p)
{
return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p);
@@ -146,19 +146,19 @@
#define utf8_isNmstrt4 isNever
-static int FASTCALL
+static int PTRFASTCALL
utf8_isInvalid2(const ENCODING *enc, const char *p)
{
return UTF8_INVALID2((const unsigned char *)p);
}
-static int FASTCALL
+static int PTRFASTCALL
utf8_isInvalid3(const ENCODING *enc, const char *p)
{
return UTF8_INVALID3((const unsigned char *)p);
}
-static int FASTCALL
+static int PTRFASTCALL
utf8_isInvalid4(const ENCODING *enc, const char *p)
{
return UTF8_INVALID4((const unsigned char *)p);
@@ -168,21 +168,21 @@
ENCODING enc;
unsigned char type[256];
#ifdef XML_MIN_SIZE
- int (FASTCALL *byteType)(const ENCODING *, const char *);
- int (FASTCALL *isNameMin)(const ENCODING *, const char *);
- int (FASTCALL *isNmstrtMin)(const ENCODING *, const char *);
- int (FASTCALL *byteToAscii)(const ENCODING *, const char *);
- int (FASTCALL *charMatches)(const ENCODING *, const char *, int);
+ int (PTRFASTCALL *byteType)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *);
+ int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *);
+ int (PTRCALL *charMatches)(const ENCODING *, const char *, int);
#endif /* XML_MIN_SIZE */
- int (FASTCALL *isName2)(const ENCODING *, const char *);
- int (FASTCALL *isName3)(const ENCODING *, const char *);
- int (FASTCALL *isName4)(const ENCODING *, const char *);
- int (FASTCALL *isNmstrt2)(const ENCODING *, const char *);
- int (FASTCALL *isNmstrt3)(const ENCODING *, const char *);
- int (FASTCALL *isNmstrt4)(const ENCODING *, const char *);
- int (FASTCALL *isInvalid2)(const ENCODING *, const char *);
- int (FASTCALL *isInvalid3)(const ENCODING *, const char *);
- int (FASTCALL *isInvalid4)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isName2)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isName3)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isName4)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *);
+ int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *);
};
#define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc))
@@ -234,7 +234,7 @@
(((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
#ifdef XML_MIN_SIZE
-static int FASTCALL
+static int PTRFASTCALL
sb_byteType(const ENCODING *enc, const char *p)
{
return SB_BYTE_TYPE(enc, p);
@@ -248,7 +248,7 @@
#ifdef XML_MIN_SIZE
#define BYTE_TO_ASCII(enc, p) \
(AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p))
-static int FASTCALL
+static int PTRFASTCALL
sb_byteToAscii(const ENCODING *enc, const char *p)
{
return *p;
@@ -277,7 +277,7 @@
#ifdef XML_MIN_SIZE
#define CHAR_MATCHES(enc, p, c) \
(AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c))
-static int FASTCALL
+static int PTRCALL
sb_charMatches(const ENCODING *enc, const char *p, int c)
{
return *p == c;
@@ -307,7 +307,7 @@
UTF8_cval4 = 0xf0
};
-static void FASTCALL
+static void PTRCALL
utf8_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
@@ -326,7 +326,7 @@
*toP = to;
}
-static void FASTCALL
+static void PTRCALL
utf8_toUtf16(const ENCODING *enc,
const char **fromP, const char *fromLim,
unsigned short **toP, const unsigned short *toLim)
@@ -414,7 +414,7 @@
STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
};
-static void FASTCALL
+static void PTRCALL
latin1_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
@@ -439,7 +439,7 @@
}
}
-static void FASTCALL
+static void PTRCALL
latin1_toUtf16(const ENCODING *enc,
const char **fromP, const char *fromLim,
unsigned short **toP, const unsigned short *toLim)
@@ -472,7 +472,7 @@
STANDARD_VTABLE(sb_)
};
-static void FASTCALL
+static void PTRCALL
ascii_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
@@ -505,7 +505,7 @@
STANDARD_VTABLE(sb_)
};
-static int FASTCALL
+static int PTRFASTCALL
unicode_byte_type(char hi, char lo)
{
switch ((unsigned char)hi) {
@@ -525,7 +525,7 @@
}
#define DEFINE_UTF16_TO_UTF8(E) \
-static void FASTCALL \
+static void PTRCALL \
E ## toUtf8(const ENCODING *enc, \
const char **fromP, const char *fromLim, \
char **toP, const char *toLim) \
@@ -588,7 +588,7 @@
}
#define DEFINE_UTF16_TO_UTF16(E) \
-static void FASTCALL \
+static void PTRCALL \
E ## toUtf16(const ENCODING *enc, \
const char **fromP, const char *fromLim, \
unsigned short **toP, const unsigned short *toLim) \
@@ -638,31 +638,31 @@
#ifdef XML_MIN_SIZE
-static int FASTCALL
+static int PTRFASTCALL
little2_byteType(const ENCODING *enc, const char *p)
{
return LITTLE2_BYTE_TYPE(enc, p);
}
-static int FASTCALL
+static int PTRFASTCALL
little2_byteToAscii(const ENCODING *enc, const char *p)
{
return LITTLE2_BYTE_TO_ASCII(enc, p);
}
-static int FASTCALL
+static int PTRCALL
little2_charMatches(const ENCODING *enc, const char *p, int c)
{
return LITTLE2_CHAR_MATCHES(enc, p, c);
}
-static int FASTCALL
+static int PTRFASTCALL
little2_isNameMin(const ENCODING *enc, const char *p)
{
return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p);
}
-static int FASTCALL
+static int PTRFASTCALL
little2_isNmstrtMin(const ENCODING *enc, const char *p)
{
return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p);
@@ -777,31 +777,31 @@
#ifdef XML_MIN_SIZE
-static int FASTCALL
+static int PTRFASTCALL
big2_byteType(const ENCODING *enc, const char *p)
{
return BIG2_BYTE_TYPE(enc, p);
}
-static int FASTCALL
+static int PTRFASTCALL
big2_byteToAscii(const ENCODING *enc, const char *p)
{
return BIG2_BYTE_TO_ASCII(enc, p);
}
-static int FASTCALL
+static int PTRCALL
big2_charMatches(const ENCODING *enc, const char *p, int c)
{
return BIG2_CHAR_MATCHES(enc, p, c);
}
-static int FASTCALL
+static int PTRFASTCALL
big2_isNameMin(const ENCODING *enc, const char *p)
{
return BIG2_IS_NAME_CHAR_MINBPC(enc, p);
}
-static int FASTCALL
+static int PTRFASTCALL
big2_isNmstrtMin(const ENCODING *enc, const char *p)
{
return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p);
@@ -922,14 +922,14 @@
return 1;
}
-static void FASTCALL
+static void PTRCALL
initUpdatePosition(const ENCODING *enc, const char *ptr,
const char *end, POSITION *pos)
{
normal_updatePosition(&utf8_encoding.enc, ptr, end, pos);
}
-static int FASTCALL
+static int
toAscii(const ENCODING *enc, const char *ptr, const char *end)
{
char buf[1];
@@ -957,7 +957,7 @@
/* Return 1 if there's just optional white space or there's an S
followed by name=val.
*/
-static int FASTCALL
+static int
parsePseudoAttribute(const ENCODING *enc,
const char *ptr,
const char *end,
@@ -1174,7 +1174,7 @@
return result;
}
-int
+int FASTCALL
XmlUtf8Encode(int c, char *buf)
{
enum {
@@ -1211,7 +1211,7 @@
return 0;
}
-int
+int FASTCALL
XmlUtf16Encode(int charNum, unsigned short *buf)
{
if (charNum < 0)
@@ -1245,7 +1245,7 @@
return sizeof(struct unknown_encoding);
}
-static int FASTCALL
+static int PTRFASTCALL
unknown_isName(const ENCODING *enc, const char *p)
{
const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
@@ -1255,7 +1255,7 @@
return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF);
}
-static int FASTCALL
+static int PTRFASTCALL
unknown_isNmstrt(const ENCODING *enc, const char *p)
{
const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
@@ -1265,7 +1265,7 @@
return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF);
}
-static int FASTCALL
+static int PTRFASTCALL
unknown_isInvalid(const ENCODING *enc, const char *p)
{
const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
@@ -1273,7 +1273,7 @@
return (c & ~0xFFFF) || checkCharRefNumber(c) < 0;
}
-static void FASTCALL
+static void PTRCALL
unknown_toUtf8(const ENCODING *enc,
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
@@ -1307,7 +1307,7 @@
}
}
-static void FASTCALL
+static void PTRCALL
unknown_toUtf16(const ENCODING *enc,
const char **fromP, const char *fromLim,
unsigned short **toP, const unsigned short *toLim)
@@ -1478,7 +1478,7 @@
*/
-static int FASTCALL
+static int
initScan(const ENCODING **encodingTable,
const INIT_ENCODING *enc,
int state,
Index: xmlrole.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlrole.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- xmlrole.h 5 Sep 2002 15:25:06 -0000 1.9
+++ xmlrole.h 20 Sep 2002 03:42:43 -0000 1.10
@@ -85,7 +85,7 @@
};
typedef struct prolog_state {
- int (FASTCALL *handler) (struct prolog_state *state,
+ int (PTRCALL *handler) (struct prolog_state *state,
int tok,
const char *ptr,
const char *end,
Index: xmlrole.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlrole.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- xmlrole.c 5 Sep 2002 01:58:27 -0000 1.13
+++ xmlrole.c 20 Sep 2002 03:42:43 -0000 1.14
@@ -85,11 +85,11 @@
#define setTopLevel(state) ((state)->handler = internalSubset)
#endif /* not XML_DTD */
-typedef int FASTCALL PROLOG_HANDLER(PROLOG_STATE *state,
- int tok,
- const char *ptr,
- const char *end,
- const ENCODING *enc);
+typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state,
+ int tok,
+ const char *ptr,
+ const char *end,
+ const ENCODING *enc);
static PROLOG_HANDLER
prolog0, prolog1, prolog2,
@@ -111,7 +111,7 @@
static int FASTCALL common(PROLOG_STATE *state, int tok);
-static int FASTCALL
+static int PTRCALL
prolog0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -148,7 +148,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
prolog1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -179,7 +179,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
prolog2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -200,7 +200,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -218,7 +218,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -248,7 +248,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -265,7 +265,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype3(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -282,7 +282,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype4(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -302,7 +302,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
doctype5(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -319,7 +319,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
internalSubset(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -374,7 +374,7 @@
#ifdef XML_DTD
-static int FASTCALL
+static int PTRCALL
externalSubset0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -387,7 +387,7 @@
return externalSubset1(state, tok, ptr, end, enc);
}
-static int FASTCALL
+static int PTRCALL
externalSubset1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -419,7 +419,7 @@
#endif /* XML_DTD */
-static int FASTCALL
+static int PTRCALL
entity0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -439,7 +439,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -456,7 +456,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -484,7 +484,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity3(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -501,7 +501,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity4(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -518,7 +518,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity5(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -541,7 +541,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity6(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -559,7 +559,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity7(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -587,7 +587,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity8(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -604,7 +604,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity9(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -621,7 +621,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
entity10(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -638,7 +638,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
notation0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -655,7 +655,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
notation1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -679,7 +679,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
notation2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -696,7 +696,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
notation3(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -714,7 +714,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
notation4(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -735,7 +735,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -753,7 +753,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -774,7 +774,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -815,7 +815,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist3(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -834,7 +834,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist4(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -854,7 +854,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist5(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -871,7 +871,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist6(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -888,7 +888,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist7(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -909,7 +909,7 @@
}
/* default value */
-static int FASTCALL
+static int PTRCALL
attlist8(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -949,7 +949,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
attlist9(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -966,7 +966,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -984,7 +984,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1014,7 +1014,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1054,7 +1054,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element3(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1079,7 +1079,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element4(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1097,7 +1097,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element5(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1118,7 +1118,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element6(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1148,7 +1148,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
element7(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1198,7 +1198,7 @@
#ifdef XML_DTD
-static int FASTCALL
+static int PTRCALL
condSect0(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1222,7 +1222,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
condSect1(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1240,7 +1240,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
condSect2(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1259,7 +1259,7 @@
#endif /* XML_DTD */
-static int FASTCALL
+static int PTRCALL
declClose(PROLOG_STATE *state,
int tok,
const char *ptr,
@@ -1276,7 +1276,7 @@
return common(state, tok);
}
-static int FASTCALL
+static int PTRCALL
error(PROLOG_STATE *state,
int tok,
const char *ptr,
Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- xmlparse.c 5 Sep 2002 18:21:00 -0000 1.86
+++ xmlparse.c 20 Sep 2002 03:42:43 -0000 1.87
@@ -272,10 +272,10 @@
ENTITY *entity;
} OPEN_INTERNAL_ENTITY;
-typedef enum XML_Error FASTCALL Processor(XML_Parser parser,
- const char *start,
- const char *end,
- const char **endPtr);
+typedef enum XML_Error PTRCALL Processor(XML_Parser parser,
+ const char *start,
+ const char *end,
+ const char **endPtr);
static Processor prologProcessor;
static Processor prologInitProcessor;
@@ -295,85 +295,85 @@
static Processor externalEntityInitProcessor3;
static Processor externalEntityContentProcessor;
-static enum XML_Error FASTCALL
+static enum XML_Error
handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName);
-static enum XML_Error FASTCALL
+static enum XML_Error
processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
const char *, const char *);
-static enum XML_Error FASTCALL
+static enum XML_Error
initializeEncoding(XML_Parser parser);
-static enum XML_Error FASTCALL
+static enum XML_Error
doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
const char *end, int tok, const char *next, const char **nextPtr);
-static enum XML_Error FASTCALL
+static enum XML_Error
processInternalParamEntity(XML_Parser parser, ENTITY *entity);
-static enum XML_Error FASTCALL
+static enum XML_Error
doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
const char *start, const char *end, const char **endPtr);
-static enum XML_Error FASTCALL
+static enum XML_Error
doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
const char *end, const char **nextPtr);
#ifdef XML_DTD
-static enum XML_Error FASTCALL
+static enum XML_Error
doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr,
const char *end, const char **nextPtr);
#endif /* XML_DTD */
-static enum XML_Error FASTCALL
+static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *,
const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
-static int FASTCALL
+static int
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr);
-static int FASTCALL
+static int
defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *,
XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue,
XML_Parser parser);
-static enum XML_Error FASTCALL
+static enum XML_Error
storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
const char *, const char *, STRING_POOL *);
-static enum XML_Error FASTCALL
+static enum XML_Error
appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
const char *, const char *, STRING_POOL *);
-static ATTRIBUTE_ID * FASTCALL
+static ATTRIBUTE_ID *
getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
const char *end);
-static int FASTCALL
+static int
setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
-static enum XML_Error FASTCALL
+static enum XML_Error
storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start,
const char *end);
-static int FASTCALL
+static int
reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end);
-static int FASTCALL
+static int
reportComment(XML_Parser parser, const ENCODING *enc, const char *start,
const char *end);
-static void FASTCALL
+static void
reportDefault(XML_Parser parser, const ENCODING *enc, const char *start,
const char *end);
-static const XML_Char * FASTCALL getContext(XML_Parser parser);
-static XML_Bool FASTCALL
+static const XML_Char * getContext(XML_Parser parser);
+static XML_Bool
setContext(XML_Parser parser, const XML_Char *context);
static void FASTCALL normalizePublicId(XML_Char *s);
-static void FASTCALL dtdInit(DTD *, XML_Parser parser);
+static void dtdInit(DTD *, XML_Parser parser);
/* do not call if parentParser != NULL */
-static void FASTCALL dtdReset(DTD *, XML_Parser parser);
-static void FASTCALL dtdDestroy(DTD *, XML_Parser parser);
+static void dtdReset(DTD *, XML_Parser parser);
+static void dtdDestroy(DTD *, XML_Parser parser);
-static int FASTCALL dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser);
+static int dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser);
-static int FASTCALL copyEntityTable(HASH_TABLE *, STRING_POOL *,
- const HASH_TABLE *, XML_Parser parser);
+static int copyEntityTable(HASH_TABLE *, STRING_POOL *,
+ const HASH_TABLE *, XML_Parser parser);
#ifdef XML_DTD
static void FASTCALL dtdSwap(DTD *, DTD *);
#endif /* XML_DTD */
-static NAMED * FASTCALL
+static NAMED *
lookup(HASH_TABLE *table, KEY name, size_t createSize);
static void FASTCALL
@@ -386,29 +386,29 @@
static void FASTCALL poolInit(STRING_POOL *, XML_Memory_Handling_Suite *ms);
static void FASTCALL poolClear(STRING_POOL *);
static void FASTCALL poolDestroy(STRING_POOL *);
-static XML_Char * FASTCALL
+static XML_Char *
poolAppend(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
-static XML_Char * FASTCALL
+static XML_Char *
poolStoreString(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
static XML_Bool FASTCALL poolGrow(STRING_POOL *pool);
static int FASTCALL nextScaffoldPart(XML_Parser parser);
-static XML_Content * FASTCALL build_model(XML_Parser parser);
+static XML_Content * build_model(XML_Parser parser);
static const XML_Char * FASTCALL
poolCopyString(STRING_POOL *pool, const XML_Char *s);
-static const XML_Char * FASTCALL
+static const XML_Char *
poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n);
static const XML_Char * FASTCALL
poolAppendString(STRING_POOL *pool, const XML_Char *s);
-static ELEMENT_TYPE * FASTCALL
+static ELEMENT_TYPE *
getElementType(XML_Parser Paraser, const ENCODING *enc,
const char *ptr, const char *end);
-static void FASTCALL
+static void
parserInit(XML_Parser parser, const XML_Char *encodingName);
#define poolStart(pool) ((pool)->start)
@@ -727,7 +727,7 @@
return parser;
}
-static void FASTCALL
+static void
parserInit(XML_Parser parser, const XML_Char *encodingName)
{
processor = prologInitProcessor;
@@ -1647,7 +1647,7 @@
processed, and not yet closed, we need to store tag->rawName in a more
permanent location, since the parse buffer is about to be discarded.
*/
-static XML_Bool FASTCALL
+static XML_Bool
storeRawNames(XML_Parser parser)
{
TAG *tag = tagStack;
@@ -1682,7 +1682,7 @@
return XML_TRUE;
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
contentProcessor(XML_Parser parser,
const char *start,
const char *end,
@@ -1697,7 +1697,7 @@
return result;
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalEntityInitProcessor(XML_Parser parser,
const char *start,
const char *end,
@@ -1710,7 +1710,7 @@
return externalEntityInitProcessor2(parser, start, end, endPtr);
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalEntityInitProcessor2(XML_Parser parser,
const char *start,
const char *end,
@@ -1750,7 +1750,7 @@
return externalEntityInitProcessor3(parser, start, end, endPtr);
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalEntityInitProcessor3(XML_Parser parser,
const char *start,
const char *end,
@@ -1787,7 +1787,7 @@
return externalEntityContentProcessor(parser, start, end, endPtr);
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalEntityContentProcessor(XML_Parser parser,
const char *start,
const char *end,
@@ -1802,7 +1802,7 @@
return result;
}
-static enum XML_Error FASTCALL
+static enum XML_Error
doContent(XML_Parser parser,
int startTagLevel,
const ENCODING *enc,
@@ -2256,7 +2256,7 @@
/* If tagNamePtr is non-null, build a real list of attributes,
otherwise just check the attributes for well-formedness.
*/
-static enum XML_Error FASTCALL
+static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *enc,
const char *attStr, TAG_NAME *tagNamePtr,
BINDING **bindingsPtr)
@@ -2510,7 +2510,7 @@
return XML_ERROR_NONE;
}
-static int FASTCALL
+static int
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
const XML_Char *uri, BINDING **bindingsPtr)
{
@@ -2565,7 +2565,7 @@
/* The idea here is to avoid using stack for each CDATA section when
the whole file is parsed with one call.
*/
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
cdataSectionProcessor(XML_Parser parser,
const char *start,
const char *end,
@@ -2589,7 +2589,7 @@
/* startPtr gets set to non-null is the section is closed, and to null if
the section is not yet closed.
*/
-static enum XML_Error FASTCALL
+static enum XML_Error
doCdataSection(XML_Parser parser,
const ENCODING *enc,
const char **startPtr,
@@ -2687,7 +2687,7 @@
/* The idea here is to avoid using stack for each IGNORE section when
the whole file is parsed with one call.
*/
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
ignoreSectionProcessor(XML_Parser parser,
const char *start,
const char *end,
@@ -2705,7 +2705,7 @@
/* startPtr gets set to non-null is the section is closed, and to null
if the section is not yet closed.
*/
-static enum XML_Error FASTCALL
+static enum XML_Error
doIgnoreSection(XML_Parser parser,
const ENCODING *enc,
const char **startPtr,
@@ -2761,7 +2761,7 @@
#endif /* XML_DTD */
-static enum XML_Error FASTCALL
+static enum XML_Error
initializeEncoding(XML_Parser parser)
{
const char *s;
@@ -2790,7 +2790,7 @@
return handleUnknownEncoding(parser, protocolEncodingName);
}
-static enum XML_Error FASTCALL
+static enum XML_Error
processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
const char *s, const char *next)
{
@@ -2875,7 +2875,7 @@
return XML_ERROR_NONE;
}
-static enum XML_Error FASTCALL
+static enum XML_Error
handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName)
{
if (unknownEncodingHandler) {
@@ -2914,7 +2914,7 @@
return XML_ERROR_UNKNOWN_ENCODING;
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
prologInitProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -2929,7 +2929,7 @@
#ifdef XML_DTD
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalParEntInitProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -2953,7 +2953,7 @@
}
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
entityValueInitProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -3007,7 +3007,7 @@
}
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
externalParEntProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -3048,7 +3048,7 @@
return doProlog(parser, encoding, s, end, tok, next, nextPtr);
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
entityValueProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -3085,7 +3085,7 @@
#endif /* XML_DTD */
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
prologProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -3096,7 +3096,7 @@
return doProlog(parser, encoding, s, end, tok, next, nextPtr);
}
-static enum XML_Error FASTCALL
+static enum XML_Error
doProlog(XML_Parser parser,
const ENCODING *enc,
const char *s,
@@ -4028,7 +4028,7 @@
/* not reached */
}
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
epilogProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -4090,7 +4090,7 @@
#ifdef XML_DTD
-static enum XML_Error FASTCALL
+static enum XML_Error
processInternalParamEntity(XML_Parser parser, ENTITY *entity)
{
const char *s, *end, *next;
@@ -4114,7 +4114,7 @@
#endif /* XML_DTD */
-static enum XML_Error FASTCALL
+static enum XML_Error PTRCALL
errorProcessor(XML_Parser parser,
const char *s,
const char *end,
@@ -4123,7 +4123,7 @@
return errorCode;
}
-static enum XML_Error FASTCALL
+static enum XML_Error
storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
const char *ptr, const char *end,
STRING_POOL *pool)
@@ -4139,7 +4139,7 @@
return XML_ERROR_NONE;
}
-static enum XML_Error FASTCALL
+static enum XML_Error
appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
const char *ptr, const char *end,
STRING_POOL *pool)
@@ -4286,7 +4286,7 @@
/* not reached */
}
-static enum XML_Error FASTCALL
+static enum XML_Error
storeEntityValue(XML_Parser parser,
const ENCODING *enc,
const char *entityTextPtr,
@@ -4474,7 +4474,7 @@
*p = XML_T('\0');
}
-static int FASTCALL
+static int
reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end)
{
@@ -4503,7 +4503,7 @@
return 1;
}
-static int FASTCALL
+static int
reportComment(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end)
{
@@ -4525,7 +4525,7 @@
return 1;
}
-static void FASTCALL
+static void
reportDefault(XML_Parser parser, const ENCODING *enc,
const char *s, const char *end)
{
@@ -4553,7 +4553,7 @@
}
-static int FASTCALL
+static int
defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
XML_Bool isId, const XML_Char *value, XML_Parser parser)
{
@@ -4596,7 +4596,7 @@
return 1;
}
-static int FASTCALL
+static int
setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
{
const XML_Char *name;
@@ -4625,7 +4625,7 @@
return 1;
}
-static ATTRIBUTE_ID * FASTCALL
+static ATTRIBUTE_ID *
getAttributeId(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end)
{
@@ -4685,7 +4685,7 @@
#define CONTEXT_SEP XML_T('\f')
-static const XML_Char * FASTCALL
+static const XML_Char *
getContext(XML_Parser parser)
{
HASH_TABLE_ITER iter;
@@ -4753,7 +4753,7 @@
return tempPool.start;
}
-static XML_Bool FASTCALL
+static XML_Bool
setContext(XML_Parser parser, const XML_Char *context)
{
const XML_Char *s = context;
@@ -4835,7 +4835,7 @@
*p = XML_T('\0');
}
-static void FASTCALL
+static void
dtdInit(DTD *p, XML_Parser parser)
{
XML_Memory_Handling_Suite *ms = &parser->m_mem;
@@ -4880,7 +4880,7 @@
#endif /* XML_DTD */
-static void FASTCALL
+static void
dtdReset(DTD *p, XML_Parser parser)
{
HASH_TABLE_ITER iter;
@@ -4926,7 +4926,7 @@
p->standalone = XML_FALSE;
}
-static void FASTCALL
+static void
dtdDestroy(DTD *p, XML_Parser parser)
{
HASH_TABLE_ITER iter;
@@ -4960,7 +4960,7 @@
/* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise.
The new DTD has already been initialized.
*/
-static int FASTCALL
+static int
dtdCopy(DTD *newDtd, const DTD *oldDtd, XML_Parser parser)
{
HASH_TABLE_ITER iter;
@@ -5090,7 +5090,7 @@
return 1;
} /* End dtdCopy */
-static int FASTCALL
+static int
copyEntityTable(HASH_TABLE *newTable,
STRING_POOL *newPool,
const HASH_TABLE *oldTable,
@@ -5177,7 +5177,7 @@
return h;
}
-static NAMED * FASTCALL
+static NAMED *
lookup(HASH_TABLE *table, KEY name, size_t createSize)
{
size_t i;
@@ -5345,7 +5345,7 @@
}
}
-static XML_Char * FASTCALL
+static XML_Char *
poolAppend(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end)
{
@@ -5373,7 +5373,7 @@
return s;
}
-static const XML_Char * FASTCALL
+static const XML_Char *
poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n)
{
if (!pool->ptr && !poolGrow(pool))
@@ -5398,7 +5398,7 @@
return pool->start;
}
-static XML_Char * FASTCALL
+static XML_Char *
poolStoreString(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end)
{
@@ -5518,7 +5518,7 @@
return next;
}
-static void FASTCALL
+static void
build_node(XML_Parser parser,
int src_node,
XML_Content *dest,
@@ -5555,7 +5555,7 @@
}
}
-static XML_Content * FASTCALL
+static XML_Content *
build_model (XML_Parser parser)
{
XML_Content *ret;
@@ -5575,7 +5575,7 @@
return ret;
}
-static ELEMENT_TYPE * FASTCALL
+static ELEMENT_TYPE *
getElementType(XML_Parser parser,
const ENCODING *enc,
const char *ptr,
Index: internal.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/internal.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- internal.h 6 Sep 2002 21:49:56 -0000 1.3
+++ internal.h 20 Sep 2002 03:42:43 -0000 1.4
@@ -3,30 +3,57 @@
Internal definitions used by Expat. This is not needed to compile
client code.
- The following definitions are made:
+ The following calling convention macros are defined for frequently
+ called functions:
- FASTCALL -- Used for most internal functions to specify that the
- fastest possible calling convention be used.
+ FASTCALL - Used for those internal functions that have a simple
+ body and a low number of arguments and local variables.
- inline -- Used for selected internal functions for which inlining
- may improve performance on some platforms.
+ PTRCALL - Used for functions called though function pointers.
+
+ PTRFASTCALL - Like PTRCALL, but for low number of arguments.
+
+ inline - Used for selected internal functions for which inlining
+ may improve performance on some platforms.
+
+ Note: Use of these macros is based on judgement, not hard rules,
+ and therefore subject to change.
*/
#if defined(__GNUC__)
-/* Last minute instability reported with egcs on a RedHat Linux 7.3
- box; argh!
+/* Instability reported with egcs on a RedHat Linux 7.3.
+ Let's comment it out:
+ #define FASTCALL __attribute__((stdcall, regparm(3)))
+ and let's try this:
*/
-/* #define FASTCALL __attribute__((stdcall, regparm(3))) */
+#define FASTCALL __attribute__((regparm(3)))
+#define PTRCALL
+#define PTRFASTCALL __attribute__((regparm(3)))
+
#elif defined(WIN32)
-/* XXX This seems to have an unexpected negative effect on Windows so
- we'll disable it for now on that platform. It may be reconsidered
- for a future release if it can be made more effective.
+/* Using __fastcall seems to have an unexpected negative effect under
+ MS VC++, especially for function pointers, so we won't use it for
+ now on that platform. It may be reconsidered for a future release
+ if it can be made more effective.
+ Likely reason: __fastcall on Windows is like stdcall, therefore
+ the compiler cannot perform stack optimizations for call clusters.
*/
-/* #define FASTCALL __fastcall */
+#define FASTCALL
+#define PTRCALL
+#define PTRFASTCALL
+
#endif
#ifndef FASTCALL
#define FASTCALL
+#endif
+
+#ifndef PTRCALL
+#define PTRCALL
+#endif
+
+#ifndef PTRFASTCALL
+#define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE