# HG changeset patch # User Mike Becker # Date 1612728879 -3600 # Node ID 8fa43b732980d0d2eded3241d807363ac254df45 # Parent a34b93911956878dc9a40e39afd9fa721bdd7c84 use C99 flexible array to mark the node's payload diff -r a34b93911956 -r 8fa43b732980 src/linked_list.c --- a/src/linked_list.c Sun Feb 07 21:03:30 2021 +0100 +++ b/src/linked_list.c Sun Feb 07 21:14:39 2021 +0100 @@ -82,7 +82,7 @@ struct cx_linked_list_node { void *prev; void *next; - int payload; + char payload[]; }; typedef struct { @@ -95,7 +95,7 @@ CxAllocator allocator = list->allocator; struct cx_linked_list_node *node = cxMalloc(allocator, - sizeof(struct cx_linked_list_node) - sizeof(int) + list->itemsize); + sizeof(struct cx_linked_list_node) + list->itemsize); if (node == NULL) return 1;