Changeset 98 for trunk/src/helpers/xmlparse.c
- Timestamp:
- Aug 21, 2001, 7:29:38 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/xmlparse.c
r97 r98 947 947 inheritedBindings = 0; 948 948 attsSize = INIT_ATTS_SIZE; 949 atts = MALLOC(attsSize * sizeof(ATTRIBUTE));949 atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE)); 950 950 nSpecifiedAtts = 0; 951 dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));951 dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); 952 952 groupSize = 0; 953 953 groupConnector = 0; … … 1065 1065 1066 1066 #ifdef XML_DTD 1067 intoldParamEntityParsing = paramEntityParsing;1067 enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; 1068 1068 1069 1069 #endif … … 2252 2252 } 2253 2253 while (bufferSize < neededSize); 2254 newBuf = MALLOC(bufferSize);2254 newBuf = (char*)MALLOC(bufferSize); 2255 2255 if (newBuf == 0) 2256 2256 { … … 2783 2783 else 2784 2784 { 2785 tag = MALLOC(sizeof(TAG));2785 tag = (TAG*)MALLOC(sizeof(TAG)); 2786 2786 if (!tag) 2787 2787 return ERROR_EXPAT_NO_MEMORY; 2788 tag->buf = MALLOC(INIT_TAG_BUF_SIZE);2788 tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE); 2789 2789 if (!tag->buf) 2790 2790 return ERROR_EXPAT_NO_MEMORY; … … 2806 2806 2807 2807 bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); 2808 tag->buf = REALLOC(tag->buf, bufSize);2808 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2809 2809 if (!tag->buf) 2810 2810 return ERROR_EXPAT_NO_MEMORY; … … 2837 2837 break; 2838 2838 bufSize = (tag->bufEnd - tag->buf) << 1; 2839 tag->buf = REALLOC(tag->buf, bufSize);2839 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2840 2840 if (!tag->buf) 2841 2841 return ERROR_EXPAT_NO_MEMORY; … … 3140 3140 3141 3141 attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; 3142 atts = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));3142 atts = (ATTRIBUTE*)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); 3143 3143 if (!atts) 3144 3144 return ERROR_EXPAT_NO_MEMORY; … … 3365 3365 { 3366 3366 TAG *p; 3367 XML_Char *uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));3367 XML_Char *uri = (XML_Char*)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); 3368 3368 3369 3369 if (!uri) … … 3397 3397 if (len > b->uriAlloc) 3398 3398 { 3399 b->uri = REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));3399 b->uri = (XML_Char*)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); 3400 3400 if (!b->uri) 3401 3401 return 0; … … 3406 3406 else 3407 3407 { 3408 b = MALLOC(sizeof(BINDING));3408 b = (BINDING*)MALLOC(sizeof(BINDING)); 3409 3409 if (!b) 3410 3410 return 0; 3411 b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));3411 b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); 3412 3412 if (!b->uri) 3413 3413 { … … 3819 3819 { 3820 3820 unknownEncodingData = info.data; 3821 unknownEncodingRelease = info.release;3821 unknownEncodingRelease = (void(*)(void*))info.release; 3822 3822 encoding = enc; 3823 3823 return ERROR_EXPAT_NONE; … … 4453 4453 if (groupSize) 4454 4454 { 4455 groupConnector = REALLOC(groupConnector, groupSize *= 2);4455 groupConnector = (char*)REALLOC(groupConnector, groupSize *= 2); 4456 4456 if (dtd.scaffIndex) 4457 dtd.scaffIndex = REALLOC(dtd.scaffIndex, groupSize * sizeof(int));4457 dtd.scaffIndex = (int*)REALLOC(dtd.scaffIndex, groupSize * sizeof(int)); 4458 4458 } 4459 4459 else 4460 groupConnector = MALLOC(groupSize = 32);4460 groupConnector = (char*)MALLOC(groupSize = 32); 4461 4461 if (!groupConnector) 4462 4462 return ERROR_EXPAT_NO_MEMORY; … … 5232 5232 { 5233 5233 type->allocDefaultAtts = 8; 5234 type->defaultAtts = MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));5234 type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5235 5235 } 5236 5236 else 5237 5237 { 5238 5238 type->allocDefaultAtts *= 2; 5239 type->defaultAtts = REALLOC(type->defaultAtts,5239 type->defaultAtts = (DEFAULT_ATTRIBUTE*)REALLOC(type->defaultAtts, 5240 5240 type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5241 5241 } … … 5814 5814 return 0; 5815 5815 tsize = INIT_SIZE * sizeof(NAMED *); 5816 table->v = table->mem->malloc_fcn(tsize);5816 table->v = (NAMED**)table->mem->malloc_fcn(tsize); 5817 5817 if (!table->v) 5818 5818 return 0; … … 5840 5840 size_t newSize = table->size * 2; 5841 5841 size_t tsize = newSize * sizeof(NAMED *); 5842 NAMED **newV = table->mem->malloc_fcn(tsize);5842 NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize); 5843 5843 5844 5844 if (!newV) … … 5866 5866 } 5867 5867 } 5868 table->v[i] = table->mem->malloc_fcn(createSize);5868 table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize); 5869 5869 if (!table->v[i]) 5870 5870 return 0; … … 6140 6140 int blockSize = (pool->end - pool->start) * 2; 6141 6141 6142 pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));6142 pool->blocks = (BLOCK*)pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); 6143 6143 if (!pool->blocks) 6144 6144 return 0; … … 6157 6157 else 6158 6158 blockSize *= 2; 6159 tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));6159 tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); 6160 6160 if (!tem) 6161 6161 return 0; … … 6180 6180 if (!dtd.scaffIndex) 6181 6181 { 6182 dtd.scaffIndex = MALLOC(groupSize * sizeof(int));6182 dtd.scaffIndex = (int*)MALLOC(groupSize * sizeof(int)); 6183 6183 6184 6184 if (!dtd.scaffIndex) … … 6273 6273 int allocsize = dtd.scaffCount * sizeof(XMLCONTENT) + dtd.contentStringLen; 6274 6274 6275 ret = MALLOC(allocsize);6275 ret = (XMLCONTENT*)MALLOC(allocsize); 6276 6276 if (!ret) 6277 6277 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.