some progress, but mainly convert the TODO's into static_assert(0, ...)
This commit is contained in:
@@ -15,10 +15,6 @@ typedef union any_align { char c; int i; long l; long long ll; float f; double d
|
||||
#define MB (KB * KB)
|
||||
#define GB (KB * KB * KB)
|
||||
#define PTR_FROM_FIELD_PTR(STRUCT, FIELD, PTR) ((STRUCT *) (((char *) PTR) - offsetof(STRUCT, FIELD)))
|
||||
#define TODO(...) do { \
|
||||
fprintf(stderr, "%s:%d: TODO: %s", __FILE__, (int)__LINE__, #__VA_ARGS__);\
|
||||
exit(1); \
|
||||
} while (0)
|
||||
|
||||
// Contains all operations an allocator can do. Similar interface to sdtlibs
|
||||
// malloc, realloc and free.
|
||||
@@ -239,11 +235,15 @@ void arr_qsort(void *this, dyn_array_cmp_fn cmp_fn);
|
||||
|
||||
// maps ////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef int (*hash_func_t)(void *key);
|
||||
typedef int (*equals_func_t)(void *key1, void *key2);
|
||||
typedef unsigned int (*hash_func_t)(void *key);
|
||||
typedef bool (*equals_func_t)(void *key1, void *key2);
|
||||
|
||||
typedef struct map_header {
|
||||
int n_items, capacity, itemsize, keysize, mapping_capacity;
|
||||
int capacity;
|
||||
int itemsize;
|
||||
int keysize;
|
||||
int mapping_capacity;
|
||||
int n_items;
|
||||
allocator_t allocator;
|
||||
hash_func_t hash;
|
||||
equals_func_t equals;
|
||||
|
||||
Reference in New Issue
Block a user