Lines Matching full:list
19 @@ -3417,23 +3417,17 @@ xmlSchemaItemListClear(xmlSchemaItemListPtr list)
21 xmlSchemaItemListAdd(xmlSchemaItemListPtr list, void *item)
23 - if (list->items == NULL) {
24 - list->items = (void **) xmlMalloc(
26 - if (list->items == NULL) {
27 - xmlSchemaPErrMemory(NULL, "allocating new item list", NULL);
30 - list->sizeItems = 20;
31 - } else if (list->sizeItems <= list->nbItems) {
32 - list->sizeItems *= 2;
33 - list->items = (void **) xmlRealloc(list->items,
34 - list->sizeItems * sizeof(void *));
35 - if (list->items == NULL) {
36 + if (list->sizeItems <= list->nbItems) {
38 + size_t newSize = list->sizeItems == 0 ? 20 : list->sizeItems * 2;
40 + tmp = (void **) xmlRealloc(list->items, newSize * sizeof(void *));
42 xmlSchemaPErrMemory(NULL, "growing item list", NULL);
43 - list->sizeItems = 0;
46 + list->items = tmp;
47 + list->sizeItems = newSize;
49 list->items[list->nbItems++] = item;
51 @@ -3474,23 +3468,17 @@ xmlSchemaItemListAddSize(xmlSchemaItemListPtr list,
53 xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx)
55 - if (list->items == NULL) {
56 - list->items = (void **) xmlMalloc(
58 - if (list->items == NULL) {
59 - xmlSchemaPErrMemory(NULL, "allocating new item list", NULL);
62 - list->sizeItems = 20;
63 - } else if (list->sizeItems <= list->nbItems) {
64 - list->sizeItems *= 2;
65 - list->items = (void **) xmlRealloc(list->items,
66 - list->sizeItems * sizeof(void *));
67 - if (list->items == NULL) {
68 + if (list->sizeItems <= list->nbItems) {
70 + size_t newSize = list->sizeItems == 0 ? 20 : list->sizeItems * 2;
72 + tmp = (void **) xmlRealloc(list->items, newSize * sizeof(void *));
74 xmlSchemaPErrMemory(NULL, "growing item list", NULL);
75 - list->sizeItems = 0;
78 + list->items = tmp;
79 + list->sizeItems = newSize;