summaryrefslogtreecommitdiffstats
path: root/src/tree.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-09-14 17:19:12 -0400
committerDavid Robillard <d@drobilla.net>2021-09-14 17:19:12 -0400
commit19235b7127bcf5597fb0436deb45c2e6af5843c6 (patch)
treebb0207a4799f67933cd793e0501d09a10822c5ec /src/tree.c
parent9572ea596d07147dbfb6db7772623e740ce28652 (diff)
downloadzix-19235b7127bcf5597fb0436deb45c2e6af5843c6.tar.gz
zix-19235b7127bcf5597fb0436deb45c2e6af5843c6.tar.bz2
zix-19235b7127bcf5597fb0436deb45c2e6af5843c6.zip
Make ZixAllocator a single flat struct
I can never decide between these two patterns for polymorphic objects in C, but this one seems more appropriate here since it's more conducive to inheritance.
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tree.c b/src/tree.c
index ccf60a6..9fa32c4 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -11,14 +11,14 @@
typedef struct ZixTreeNodeImpl ZixTreeNode;
struct ZixTreeImpl {
- const ZixAllocator* allocator;
- ZixTreeNode* root;
- ZixDestroyFunc destroy;
- const void* destroy_user_data;
- ZixComparator cmp;
- void* cmp_data;
- size_t size;
- bool allow_duplicates;
+ ZixAllocator* allocator;
+ ZixTreeNode* root;
+ ZixDestroyFunc destroy;
+ const void* destroy_user_data;
+ ZixComparator cmp;
+ void* cmp_data;
+ size_t size;
+ bool allow_duplicates;
};
struct ZixTreeNodeImpl {
@@ -54,12 +54,12 @@ struct ZixTreeNodeImpl {
#endif
ZixTree*
-zix_tree_new(const ZixAllocator* const allocator,
- bool allow_duplicates,
- ZixComparator cmp,
- void* cmp_data,
- ZixDestroyFunc destroy,
- const void* destroy_user_data)
+zix_tree_new(ZixAllocator* const allocator,
+ bool allow_duplicates,
+ ZixComparator cmp,
+ void* cmp_data,
+ ZixDestroyFunc destroy,
+ const void* destroy_user_data)
{
ZixTree* t = (ZixTree*)zix_malloc(allocator, sizeof(ZixTree));