diff options
author | justanothercatgirl <sotov2070@gmail.com> | 2024-06-28 00:06:40 +0300 |
---|---|---|
committer | justanothercatgirl <sotov2070@gmail.com> | 2024-06-28 00:52:08 +0300 |
commit | ebad5ad23dc6893b0fb75ba04aa961a25a532b5f (patch) | |
tree | c025946d4248b46aceae3e15c19efd29b2d12af2 /tests/linked_list.c | |
parent | 28bb6070e64f25aa6ff64f81b59a7f52e12d4092 (diff) |
Finished hash_map implementation
TODO: fix that one linked list function
Diffstat (limited to 'tests/linked_list.c')
-rw-r--r-- | tests/linked_list.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/linked_list.c b/tests/linked_list.c index 1682375..7068e83 100644 --- a/tests/linked_list.c +++ b/tests/linked_list.c @@ -4,15 +4,15 @@ void print_linked_list(struct linked_list* list) { int i = 0; - printf("linked list at %p, size = %zu\n", list, list->meta.assumed_size); - printf("first=%p, last=%p\n", list->first, list->last); + printf("linked list at %p, size = %zu\n", (void*)list, list->meta.assumed_size); + printf("first=%p, last=%p\n", (void*)list->first, (void*)list->last); for (struct linked_list_node* current = list->first; current != NULL; current = current->next) { - printf("[%i] = {%i, %p}\n", i, *(int*)current->data, current->next); + printf("[%i] = {%i, %p}\n", i, *(int*)current->data, (void*)current->next); ++i; } } -int main() { +int main(void) { int buf[] = {0, 1, 3, 2, 7, 8, 6, 0, 18, 1}; struct linked_list list = ll_create_from_buffer(sizeof(int), buf, sizeof(buf)/sizeof(*buf)); @@ -24,7 +24,8 @@ int main() { ll_insert_front(&list, &one); ll_append(&list, &one); ll_append(&list, &one); - ll_remove_all(&list, &one, __default_int_cmp); + // TODO: fix this function + ll_remove_all(&list, &one, __default_int_cmp); print_linked_list(&list); ll_remove_at(&list, 3); ll_remove_back(&list); |