diff options
| author | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 15:49:59 +0100 |
|---|---|---|
| committer | Mikkel Thestrup <mithe24@student.sdu.dk> | 2025-11-30 15:49:59 +0100 |
| commit | c645866ceb7688b6b426144577d332c1d733b69d (patch) | |
| tree | 3b8c01a2a9ca2798ea813c87ddedf7c9e112fffc | |
| parent | a23cb6d6f011950b11789898c10e63f4473a5200 (diff) | |
| download | cycle-detector-c645866ceb7688b6b426144577d332c1d733b69d.tar.gz cycle-detector-c645866ceb7688b6b426144577d332c1d733b69d.zip | |
Added explicit casts
Diffstat (limited to '')
| -rw-r--r-- | src/linked_list.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linked_list.c b/src/linked_list.c index c655fe4..0a6850d 100644 --- a/src/linked_list.c +++ b/src/linked_list.c @@ -2,7 +2,7 @@ #include <stdlib.h> LinkedList *linked_list_new(void) { - LinkedList *ll = malloc(sizeof(LinkedList)); + LinkedList *ll = (LinkedList *)malloc(sizeof(LinkedList)); if (!ll) return NULL; ll->head = NULL; @@ -26,7 +26,7 @@ void linked_list_delete(LinkedList *ll) { } LinkedListNode *linked_list_append(LinkedList *ll, void *elem) { - LinkedListNode *new_node = malloc(sizeof(LinkedListNode)); + LinkedListNode *new_node = (LinkedListNode *)malloc(sizeof(LinkedListNode)); if (!new_node) return NULL; new_node->data = elem; |