diff options
author | David Robillard <d@drobilla.net> | 2019-10-18 20:07:52 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-10-18 20:15:53 +0200 |
commit | 92e2833403321fe630b22ccdeb00a31fec7785aa (patch) | |
tree | af69201d4ae1d02ce3e57fc179cbbfe6cda4feb7 /zix | |
parent | 7f9f0d2b6e7ac33e5b2cc5060481a2cc1d429a7d (diff) | |
download | zix-92e2833403321fe630b22ccdeb00a31fec7785aa.tar.gz zix-92e2833403321fe630b22ccdeb00a31fec7785aa.tar.bz2 zix-92e2833403321fe630b22ccdeb00a31fec7785aa.zip |
Fix building as C++
Diffstat (limited to 'zix')
-rw-r--r-- | zix/ampatree.c | 6 | ||||
-rw-r--r-- | zix/patree.c | 4 | ||||
-rw-r--r-- | zix/strindex.c | 2 | ||||
-rw-r--r-- | zix/trie.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/zix/ampatree.c b/zix/ampatree.c index f0a45a3..58d1332 100644 --- a/zix/ampatree.c +++ b/zix/ampatree.c @@ -108,7 +108,7 @@ zix_ampatree_new(void) { ZixAMPatree* t = (ZixAMPatree*)calloc(1, sizeof(ZixAMPatree)); - t->root = calloc(1, sizeof(ZixAMPatreeNode)); + t->root = (ZixAMPatreeNode*)calloc(1, sizeof(ZixAMPatreeNode)); return t; } @@ -171,8 +171,8 @@ patree_add_edge(ZixAMPatreeNode** n_ptr, child->str = str; child->n_children = 0; - n = realloc_node(n, n->n_children + 1); - ZixAMPatreeNode* m = malloc(zix_ampatree_node_size(n->n_children + 1)); + n = (ZixAMPatreeNode*)realloc_node(n, n->n_children + 1); + ZixAMPatreeNode* m = (ZixAMPatreeNode*)malloc(zix_ampatree_node_size(n->n_children + 1)); m->label_first = n->label_first; m->label_last = n->label_last; m->str = n->str; diff --git a/zix/patree.c b/zix/patree.c index fe552d8..f984005 100644 --- a/zix/patree.c +++ b/zix/patree.c @@ -122,7 +122,7 @@ zix_patree_new(void) { ZixPatree* t = (ZixPatree*)calloc(1, sizeof(ZixPatree)); - t->root = calloc(1, sizeof(ZixPatreeNode)); + t->root = (ZixPatreeNode*)calloc(1, sizeof(ZixPatreeNode)); return t; } @@ -196,7 +196,7 @@ patree_add_edge(ZixPatreeNode** n_ptr, *zix_patree_get_child_ptr(n, n->n_children - 1) = child; #else const n_edges_t l = zix_trie_find_key(n->children, n->n_children, first[0]); - ZixPatreeNode* m = malloc(zix_patree_node_size(n->n_children + 1)); + ZixPatreeNode* m = (ZixPatreeNode*)malloc(zix_patree_node_size(n->n_children + 1)); m->label_first = n->label_first; m->label_last = n->label_last; m->str = n->str; diff --git a/zix/strindex.c b/zix/strindex.c index 6323944..fffc94f 100644 --- a/zix/strindex.c +++ b/zix/strindex.c @@ -53,7 +53,7 @@ zix_strindex_new(const char* s) ZixStrindex* t = (ZixStrindex*)malloc(sizeof(ZixStrindex)); memset(t, '\0', sizeof(struct _ZixStrindex)); - t->s = calloc(1, len + 1); + t->s = (char*)calloc(1, len + 1); memcpy(t->s, s, len); t->root = (ZixStrindexNode*)malloc(sizeof(ZixStrindexNode)); @@ -111,7 +111,7 @@ zix_trie_new(void) { ZixTrie* t = (ZixTrie*)calloc(1, sizeof(ZixTrie)); - t->root = calloc(1, sizeof(ZixTrieNode)); + t->root = (ZixTrieNode*)calloc(1, sizeof(ZixTrieNode)); return t; } @@ -177,7 +177,7 @@ zix_trie_add_child(ZixTrieNode** n_ptr, *zix_trie_get_child_ptr(n, n->num_children - 1) = child; #else const n_edges_t l = zix_trie_find_key(n->children, n->num_children, first); - ZixTrieNode* m = malloc(zix_trie_node_size(n->num_children + 1)); + ZixTrieNode* m = (ZixTrieNode*)malloc(zix_trie_node_size(n->num_children + 1)); m->str = n->str; m->num_children = n->num_children + 1; |