diff options
| author | Mosder <git@mosder.eu> | 2026-09-15 15:52:47 +0200 |
|---|---|---|
| committer | Mosder <git@mosder.eu> | 2026-09-15 15:52:47 +0200 |
| commit | 451a320920c6e2f60445938aa98d4fe817c3d36a (patch) | |
| tree | 02e6b7bd9a6e2824ef332b0143c98348ff8c85b3 /analyzer/structures | |
| parent | ad5eb982de97d982bc808ece89903d1113ab9917 (diff) | |
Diffstat (limited to 'analyzer/structures')
| -rw-r--r-- | analyzer/structures/array.c | 4 | ||||
| -rw-r--r-- | analyzer/structures/hashmap.h | 6 | ||||
| -rw-r--r-- | analyzer/structures/heap.h | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/analyzer/structures/array.c b/analyzer/structures/array.c index 7c7d4f8..faaed60 100644 --- a/analyzer/structures/array.c +++ b/analyzer/structures/array.c @@ -80,7 +80,9 @@ void array_remove_front(DynArray *array, size_t to_remove) { } array->count -= to_remove; - memmove(array->data, (char *)array->data + to_remove * array->el_size, array->count * array->el_size); + memmove( + array->data, (char *)array->data + to_remove * array->el_size, array->count * array->el_size + ); } void array_remove_back(DynArray *array, size_t to_remove) { diff --git a/analyzer/structures/hashmap.h b/analyzer/structures/hashmap.h index 7559010..227b15b 100644 --- a/analyzer/structures/hashmap.h +++ b/analyzer/structures/hashmap.h @@ -40,11 +40,13 @@ typedef struct { // - key2 - pointer to the second of the keys to compare // returns: // truthy if the keys are identical, falsy if they are different -// - key_cleanup - function for cleaning up any internal allocations inside node->key (not the key itself) +// - key_cleanup - function for cleaning up any internal allocations inside node->key (not the +// key itself) // if it has no heap allocations, this should be NULL // params: // - key - pointer to the key to cleanup -// - val_cleanup - function for cleaning up any internal allocations inside node->val (not the value itself) +// - val_cleanup - function for cleaning up any internal allocations inside node->val (not the +// value itself) // if it has no heap allocations, this should be NULL // params: // - val - pointer to the value to cleanup diff --git a/analyzer/structures/heap.h b/analyzer/structures/heap.h index a2d7333..bfeb4b6 100644 --- a/analyzer/structures/heap.h +++ b/analyzer/structures/heap.h @@ -27,13 +27,15 @@ typedef struct { // - el2 - pointer to the second of the elements to compare // returns: // truthy if el1 should be el2's parent (e.g. el1 > el2 for max heap), falsy otherwise -// - el_cleanup - function for cleaning up any internal allocations inside element (not the element itself) +// - el_cleanup - function for cleaning up any internal allocations inside element (not the +// element itself) // if it has no heap allocations, this should be NULL // params: // - el - pointer to the element to cleanup // returns: // pointer to the new heap -extern Heap *heap_new(size_t el_size, int (*compare)(void *el1, void *el2), void (*el_cleanup)(void *el)); +extern Heap * +heap_new(size_t el_size, int (*compare)(void *el1, void *el2), void (*el_cleanup)(void *el)); // insert new element into the heap // params: |
