Reformat
This commit is contained in:
@@ -18,8 +18,8 @@ GenericList *_dbl_list_alloc(const Allocator *allocator, u64 item_size) {
|
||||
if (!list) { goto DBL_LIST_ALLOC_RETURN; }
|
||||
|
||||
memset((void *)list, 0, sizeof(GenericList));
|
||||
list->magic = WAPP_DBL_LIST_MAGIC;
|
||||
list->item_size = item_size;
|
||||
list->magic = WAPP_DBL_LIST_MAGIC;
|
||||
list->item_size = item_size;
|
||||
|
||||
DBL_LIST_ALLOC_RETURN:
|
||||
return list;
|
||||
@@ -32,8 +32,8 @@ GenericNode *_dbl_list_node_alloc(const Allocator *allocator, u64 item_size) {
|
||||
if (!node) { goto DBL_LIST_NODE_ALLOC_RETURN; }
|
||||
|
||||
memset((void *)node, 0, sizeof(GenericNode));
|
||||
node->magic = WAPP_DBL_NODE_MAGIC;
|
||||
node->item_size = item_size;
|
||||
node->magic = WAPP_DBL_NODE_MAGIC;
|
||||
node->item_size = item_size;
|
||||
|
||||
DBL_LIST_NODE_ALLOC_RETURN:
|
||||
return node;
|
||||
@@ -44,8 +44,8 @@ GenericNode *_dbl_list_get(const GenericList *list, u64 index, u64 item_size) {
|
||||
_dbl_list_validate(list, item_size);
|
||||
wapp_runtime_assert(index < list->node_count, "`index` is out of bounds");
|
||||
|
||||
GenericNode *output = NULL;
|
||||
GenericNode *current = list->first;
|
||||
GenericNode *output = NULL;
|
||||
GenericNode *current = list->first;
|
||||
for (u64 i = 1; i <= index; ++i) {
|
||||
current = current->next;
|
||||
}
|
||||
@@ -74,8 +74,8 @@ void _dbl_list_push_front(GenericList *list, GenericNode *node, u64 item_size) {
|
||||
first->prev = node_list.last;
|
||||
}
|
||||
|
||||
list->first = node_list.first;
|
||||
node_list.last->next = first;
|
||||
list->first = node_list.first;
|
||||
node_list.last->next = first;
|
||||
}
|
||||
|
||||
void _dbl_list_push_back(GenericList *list, GenericNode *node, u64 item_size) {
|
||||
@@ -98,7 +98,7 @@ void _dbl_list_push_back(GenericList *list, GenericNode *node, u64 item_size) {
|
||||
}
|
||||
|
||||
list->last = node_list.last;
|
||||
node_list.first->prev = last;
|
||||
node_list.first->prev = last;
|
||||
}
|
||||
|
||||
void _dbl_list_insert(GenericList *list, GenericNode *node, u64 index, u64 item_size) {
|
||||
@@ -125,8 +125,8 @@ void _dbl_list_insert(GenericList *list, GenericNode *node, u64 index, u64 item_
|
||||
|
||||
GenericNode *prev = dst_node->prev;
|
||||
|
||||
dst_node->prev = node_list.last;
|
||||
prev->next = node_list.first;
|
||||
dst_node->prev = node_list.last;
|
||||
prev->next = node_list.first;
|
||||
|
||||
node_list.first->prev = prev;
|
||||
node_list.last->next = dst_node;
|
||||
|
||||
Reference in New Issue
Block a user