parser
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
}\
|
||||
\
|
||||
static inline List_##T List_##T##_alloc(u32 len){\
|
||||
return List_##T##_construct(len > 0 ? malloc(len * sizeof(T)) : NULL, 0, 0);\
|
||||
return List_##T##_construct((T*)(len > 0 ? malloc(len * sizeof(T)) : NULL), 0, 0);\
|
||||
}\
|
||||
\
|
||||
void List_##T##_push(List_##T* ptr, T value);
|
||||
@@ -27,7 +27,7 @@
|
||||
max_len += __List_padding_in_sizeof_T(T);\
|
||||
/* branchless version of max(max_len, __List_min_size) */\
|
||||
max_len += (max_len < __List_min_size) * (__List_min_size - max_len);\
|
||||
ptr->data = realloc(ptr->data, max_len * sizeof(T));\
|
||||
ptr->data = (T*)realloc(ptr->data, max_len * sizeof(T));\
|
||||
ptr->max_len = max_len;\
|
||||
}\
|
||||
ptr->data[ptr->len++] = value;\
|
||||
|
||||
Reference in New Issue
Block a user