void* -> CSSNodeRef in CSSNodeList
Summary: This list can only contain CSSNodeRefs so don't use void* Reviewed By: gkassabli Differential Revision: D4101773 fbshipit-source-id: 8a5c9066da796967bd02ce6b1fc74ff40e15dfe1
This commit is contained in:
committed by
Facebook Github Bot
parent
df6368e048
commit
267e17f23a
@@ -12,7 +12,7 @@
|
|||||||
struct CSSNodeList {
|
struct CSSNodeList {
|
||||||
uint32_t capacity;
|
uint32_t capacity;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
void **items;
|
CSSNodeRef *items;
|
||||||
};
|
};
|
||||||
|
|
||||||
CSSNodeListRef CSSNodeListNew(const uint32_t initialCapacity) {
|
CSSNodeListRef CSSNodeListNew(const uint32_t initialCapacity) {
|
||||||
@@ -21,7 +21,7 @@ CSSNodeListRef CSSNodeListNew(const uint32_t initialCapacity) {
|
|||||||
|
|
||||||
list->capacity = initialCapacity;
|
list->capacity = initialCapacity;
|
||||||
list->count = 0;
|
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");
|
CSS_ASSERT(list->items != NULL, "Could not allocate memory for items");
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
@@ -56,7 +56,7 @@ void CSSNodeListInsert(CSSNodeListRef *listp, const CSSNodeRef node, const uint3
|
|||||||
|
|
||||||
if (list->count == list->capacity) {
|
if (list->count == list->capacity) {
|
||||||
list->capacity *= 2;
|
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");
|
CSS_ASSERT(list->items != NULL, "Could not extend allocation for items");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user