void* -> CSSNodeRef in CSSNodeList
Reviewed By: gkassabli Differential Revision: D4101773 fbshipit-source-id: 8a5c9066da796967bd02ce6b1fc74ff40e15dfe1
This commit is contained in:
parent
d4b8ae7a8a
commit
d0f8e7f35c
|
@ -12,7 +12,7 @@
|
|||
struct CSSNodeList {
|
||||
uint32_t capacity;
|
||||
uint32_t count;
|
||||
void **items;
|
||||
CSSNodeRef *items;
|
||||
};
|
||||
|
||||
CSSNodeListRef CSSNodeListNew(const uint32_t initialCapacity) {
|
||||
|
@ -21,7 +21,7 @@ CSSNodeListRef CSSNodeListNew(const uint32_t initialCapacity) {
|
|||
|
||||
list->capacity = initialCapacity;
|
||||
list->count = 0;
|
||||
list->items = malloc(sizeof(void *) * list->capacity);
|
||||
list->items = malloc(sizeof(CSSNodeRef) * list->capacity);
|
||||
CSS_ASSERT(list->items != NULL, "Could not allocate memory for items");
|
||||
|
||||
return list;
|
||||
|
@ -56,7 +56,7 @@ void CSSNodeListInsert(CSSNodeListRef *listp, const CSSNodeRef node, const uint3
|
|||
|
||||
if (list->count == list->capacity) {
|
||||
list->capacity *= 2;
|
||||
list->items = realloc(list->items, sizeof(void *) * list->capacity);
|
||||
list->items = realloc(list->items, sizeof(CSSNodeRef) * list->capacity);
|
||||
CSS_ASSERT(list->items != NULL, "Could not extend allocation for items");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue