XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler;
XML_NotStandaloneHandler m_notStandaloneHandler;
XML_ExternalEntityRefHandler m_externalEntityRefHandler;
- void *m_externalEntityRefHandlerArg;
+ XML_Parser m_externalEntityRefHandlerArg;
XML_SkippedEntityHandler m_skippedEntityHandler;
XML_UnknownEncodingHandler m_unknownEncodingHandler;
XML_ElementDeclHandler m_elementDeclHandler;
if (memsuite) {
XML_Memory_Handling_Suite *mtemp;
- parser = (struct XML_ParserStruct*)
+ parser = (XML_Parser)
memsuite->malloc_fcn(sizeof(struct XML_ParserStruct));
if (parser != NULL) {
mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
}
else {
XML_Memory_Handling_Suite *mtemp;
- parser = (struct XML_ParserStruct*)malloc(sizeof(struct XML_ParserStruct));
+ parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct));
if (parser != NULL) {
mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
mtemp->malloc_fcn = malloc;
bufferLim = NULL;
attsSize = INIT_ATTS_SIZE;
- atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE));
+ atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE));
if (atts == NULL) {
FREE(parser);
return NULL;
}
- dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
+ dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
if (dataBuf == NULL) {
FREE(atts);
FREE(parser);
void *oldUserData = userData;
void *oldHandlerArg = handlerArg;
XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
- void *oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
+ XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
#ifdef XML_DTD
- int oldParamEntityParsing = paramEntityParsing;
+ enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
int oldInEntityValue = prologState.inEntityValue;
#endif
XML_Bool oldns_triplets = ns_triplets;
XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
{
if (arg)
- externalEntityRefHandlerArg = arg;
+ externalEntityRefHandlerArg = (XML_Parser)arg;
else
externalEntityRefHandlerArg = parser;
}
/* FIXME avoid integer overflow */
char *temp;
temp = (buffer == NULL
- ? (char*)MALLOC(len * 2)
- : (char*)REALLOC(buffer, len * 2));
+ ? (char *)MALLOC(len * 2)
+ : (char *)REALLOC(buffer, len * 2));
if (temp == NULL) {
errorCode = XML_ERROR_NO_MEMORY;
return XML_STATUS_ERROR;
do {
bufferSize *= 2;
} while (bufferSize < neededSize);
- newBuf = (char*)MALLOC(bufferSize);
+ newBuf = (char *)MALLOC(bufferSize);
if (newBuf == 0) {
errorCode = XML_ERROR_NO_MEMORY;
return NULL;
*/
bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
if (bufSize > tag->bufEnd - tag->buf) {
- char *temp = (char*)REALLOC(tag->buf, bufSize);
+ char *temp = (char *)REALLOC(tag->buf, bufSize);
if (temp == NULL)
return XML_FALSE;
/* if tag->name.str points to tag->buf (only when namespace
freeTagList = freeTagList->parent;
}
else {
- tag = (TAG*)MALLOC(sizeof(TAG));
+ tag = (TAG *)MALLOC(sizeof(TAG));
if (!tag)
return XML_ERROR_NO_MEMORY;
- tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE);
+ tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE);
if (!tag->buf) {
FREE(tag);
return XML_ERROR_NO_MEMORY;
}
bufSize = (tag->bufEnd - tag->buf) << 1;
{
- char *temp = (char*)REALLOC(tag->buf, bufSize);
+ char *temp = (char *)REALLOC(tag->buf, bufSize);
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
tag->buf = temp;
if (freeBindingList) {
b = freeBindingList;
if (len > b->uriAlloc) {
- XML_Char *temp = (XML_Char*)REALLOC(b->uri,
- sizeof(XML_Char) * (len + EXPAND_SPARE));
+ XML_Char *temp = (XML_Char *)REALLOC(b->uri,
+ sizeof(XML_Char) * (len + EXPAND_SPARE));
if (temp == NULL)
return 0;
b->uri = temp;
freeBindingList = b->nextTagBinding;
}
else {
- b = (BINDING*)MALLOC(sizeof(BINDING));
+ b = (BINDING *)MALLOC(sizeof(BINDING));
if (!b)
return 0;
- b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
+ b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
if (!b->uri) {
FREE(b);
return 0;
case XML_ROLE_GROUP_OPEN:
if (prologState.level >= groupSize) {
if (groupSize) {
- char *temp = (char*)REALLOC(groupConnector, groupSize *= 2);
+ char *temp = (char *)REALLOC(groupConnector, groupSize *= 2);
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
groupConnector = temp;
if (dtd->scaffIndex) {
- int *temp = (int*)REALLOC(dtd->scaffIndex,
- groupSize * sizeof(int));
+ int *temp = (int *)REALLOC(dtd->scaffIndex,
+ groupSize * sizeof(int));
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
dtd->scaffIndex = temp;
}
}
else {
- groupConnector = (char*)MALLOC(groupSize = 32);
+ groupConnector = (char *)MALLOC(groupSize = 32);
if (!groupConnector)
return XML_ERROR_NO_MEMORY;
}
if (type->nDefaultAtts == type->allocDefaultAtts) {
if (type->allocDefaultAtts == 0) {
type->allocDefaultAtts = 8;
- type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts
- * sizeof(DEFAULT_ATTRIBUTE));
+ type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts
+ * sizeof(DEFAULT_ATTRIBUTE));
if (!type->defaultAtts)
return 0;
}
else {
DEFAULT_ATTRIBUTE *temp;
int count = type->allocDefaultAtts * 2;
- temp = (DEFAULT_ATTRIBUTE*)
- REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE)));
+ temp = (DEFAULT_ATTRIBUTE *)
+ REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE)));
if (temp == NULL)
return 0;
type->allocDefaultAtts = count;
static DTD *
dtdCreate(const XML_Memory_Handling_Suite *ms)
{
- DTD *p = ms->malloc_fcn(sizeof(DTD));
+ DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD));
if (p == NULL)
return p;
poolInit(&(p->pool), ms);
if (!createSize)
return NULL;
tsize = INIT_SIZE * sizeof(NAMED *);
- table->v = (NAMED**)table->mem->malloc_fcn(tsize);
+ table->v = (NAMED **)table->mem->malloc_fcn(tsize);
if (!table->v)
return NULL;
memset(table->v, 0, tsize);
/* check for overflow */
size_t newSize = table->size * 2;
size_t tsize = newSize * sizeof(NAMED *);
- NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize);
+ NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize);
if (!newV)
return NULL;
memset(newV, 0, tsize);
;
}
}
- table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize);
+ table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize);
if (!table->v[i])
return NULL;
memset(table->v[i], 0, createSize);
}
if (pool->blocks && pool->start == pool->blocks->s) {
int blockSize = (pool->end - pool->start)*2;
- pool->blocks = (BLOCK*)
+ pool->blocks = (BLOCK *)
pool->mem->realloc_fcn(pool->blocks,
(offsetof(BLOCK, s)
+ blockSize * sizeof(XML_Char)));
blockSize = INIT_BLOCK_SIZE;
else
blockSize *= 2;
- tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s)
+ tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s)
+ blockSize * sizeof(XML_Char));
if (!tem)
return XML_FALSE;
int next;
if (!dtd->scaffIndex) {
- dtd->scaffIndex = (int*)MALLOC(groupSize * sizeof(int));
+ dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
if (!dtd->scaffIndex)
return -1;
dtd->scaffIndex[0] = 0;