Minor fixes
This commit is contained in:
@@ -32,9 +32,9 @@ extern rbnode_t* libcdsb_rbtree_node_delete(rbnode_t** root, rbnode_t* node)
|
||||
extern void* libcdsb_rbtree_duplicate(const rbnode_t* s, void* (*node_duplicate)(void* src, void* parent, void* info), void* info) wur__ Nonnull__(1);
|
||||
extern int libcdsb_rbtree_compare (const rbnode_t* s0, const rbnode_t* s1, int (*node_compare)(const rbnode_t* s0, const rbnode_t* s1, void* info), void* info) pure__ wur__ Nonnull__(1,2);
|
||||
|
||||
extern hash_t libcdsb_rbtree_hash(const void* s, hash_t (*node_hash)(const void* s, void* info), void* info) pure__ wur__ Nonnull__(1,2);
|
||||
extern size_t libcdsb_rbtree_size(const void* s) pure__ wur__ Nonnull__(1);
|
||||
extern void libcdsb_rbtree_free(void* x, void (*node_free)(void* x, void* info), void* info) Nonnull__(1);
|
||||
extern hash_t libcdsb_rbtree_hash(const void* s, hash_t (*node_hash)(const void* s, void* info), void* info) pure__ wur__ Nonnull__(1);
|
||||
extern size_t libcdsb_rbtree_size(const void* s) pure__ wur__ Nonnull__(1);
|
||||
extern void libcdsb_rbtree_free(void* x, void (*node_free)(void* x, void* info), void* info) Nonnull__(1);
|
||||
|
||||
#define rbtree_duplicate libcdsb_rbtree_duplicate
|
||||
#define rbtree_compare libcdsb_rbtree_compare
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
typedef union {
|
||||
void* ptr; bool b;
|
||||
str_t s; arr_t a; list_t l;
|
||||
map_t m; set_t vs;
|
||||
map_t m; set_t vs; dict_t vd;
|
||||
u8_t u8; u16_t u16; u32_t u32; u64_t u64;
|
||||
fl_t f; dbl_t d; ldbl_t ld;
|
||||
} var_t;
|
||||
|
||||
@@ -55,6 +55,9 @@ char* libcdsb_strdup(const char* s) {
|
||||
void* x;
|
||||
size_t n;
|
||||
|
||||
if (is_null(s))
|
||||
return nullptr;
|
||||
|
||||
if ((x = malloc(n = strlen(s) + 1)))
|
||||
return memcpy(x, s, n);
|
||||
abort();
|
||||
|
||||
Reference in New Issue
Block a user