Fixed some include guards for cmc_hashtable_primes and cmc_entry_state
Also removed unnecessary typedef for enum cmc_entry_state Now cmc_entry state is in another guard, separated from the cmc_hashtable_primes guard
This commit is contained in:
1 parent
344e9f77fe
commit
d9171a11cf
4 files changed
+33
-18
No files matched your search
+10
-5
@@ -29,15 +29,20 @@
|
||||
/* to_string format */
|
||||
static const char *cmc_string_fmt_hashmap = "%s at %p { buffer:%p, capacity:%" PRIuMAX ", count:%" PRIuMAX ", load:%lf, cmp:%p, hash:%p }";
|
||||
|
||||
#ifndef CMC_HASH_TABLE_SETUP
|
||||
#define CMC_HASH_TABLE_SETUP
|
||||
#ifndef CMC_IMPL_HASHTABLE_STATE
|
||||
#define CMC_IMPL_HASHTABLE_STATE
|
||||
|
||||
typedef enum cmc_entry_state_e
|
||||
enum cmc_entry_state_e
|
||||
{
|
||||
CMC_ES_DELETED = -1,
|
||||
CMC_ES_EMPTY = 0,
|
||||
CMC_ES_FILLED = 1
|
||||
} cmc_entry_state;
|
||||
};
|
||||
|
||||
#endif /* CMC_IMPL_HASHTABLE_STATE */
|
||||
|
||||
#ifndef CMC_IMPL_HASHTABLE_SETUP
|
||||
#define CMC_IMPL_HASHTABLE_SETUP
|
||||
|
||||
static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
3067, 6143, 12289, 24571, 49157,
|
||||
@@ -71,7 +76,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
6917529027641081903,
|
||||
13835058055282163729llu};
|
||||
|
||||
#endif /* CMC_HASH_TABLE_SETUP */
|
||||
#endif /* CMC_IMPL_HASHTABLE_SETUP */
|
||||
|
||||
#define CMC_GENERATE_HASHMAP(PFX, SNAME, K, V) \
|
||||
CMC_GENERATE_HASHMAP_HEADER(PFX, SNAME, K, V) \
|
||||
|
||||
+10
-5
@@ -28,15 +28,20 @@
|
||||
/* to_string format */
|
||||
static const char *cmc_string_fmt_hashset = "%s at %p { buffer:%p, capacity:%" PRIuMAX ", count:%" PRIuMAX ", load:%lf, cmp:%p, hash:%p }";
|
||||
|
||||
#ifndef CMC_HASH_TABLE_SETUP
|
||||
#define CMC_HASH_TABLE_SETUP
|
||||
#ifndef CMC_IMPL_HASHTABLE_STATE
|
||||
#define CMC_IMPL_HASHTABLE_STATE
|
||||
|
||||
typedef enum cmc_entry_state_e
|
||||
enum cmc_entry_state_e
|
||||
{
|
||||
CMC_ES_DELETED = -1,
|
||||
CMC_ES_EMPTY = 0,
|
||||
CMC_ES_FILLED = 1
|
||||
} cmc_entry_state;
|
||||
};
|
||||
|
||||
#endif /* CMC_IMPL_HASHTABLE_STATE */
|
||||
|
||||
#ifndef CMC_IMPL_HASHTABLE_SETUP
|
||||
#define CMC_IMPL_HASHTABLE_SETUP
|
||||
|
||||
static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
3067, 6143, 12289, 24571, 49157,
|
||||
@@ -70,7 +75,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
6917529027641081903,
|
||||
13835058055282163729llu};
|
||||
|
||||
#endif /* CMC_HASH_TABLE_SETUP */
|
||||
#endif /* CMC_IMPL_HASHTABLE_SETUP */
|
||||
|
||||
#define CMC_GENERATE_HASHSET(PFX, SNAME, V) \
|
||||
CMC_GENERATE_HASHSET_HEADER(PFX, SNAME, V) \
|
||||
|
||||
+3
-3
@@ -53,8 +53,8 @@
|
||||
/* to_string format */
|
||||
static const char *cmc_string_fmt_multimap = "%s at %p { buffer:%p, capacity:%" PRIuMAX ", count:%" PRIuMAX ", load:%lf, cmp:%p, hash:%p }";
|
||||
|
||||
#ifndef CMC_HASH_TABLE_SETUP
|
||||
#define CMC_HASH_TABLE_SETUP
|
||||
#ifndef CMC_IMPL_HASHTABLE_SETUP
|
||||
#define CMC_IMPL_HASHTABLE_SETUP
|
||||
|
||||
static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
3067, 6143, 12289, 24571, 49157,
|
||||
@@ -88,7 +88,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
6917529027641081903,
|
||||
13835058055282163729llu};
|
||||
|
||||
#endif /* CMC_HASH_TABLE_SETUP */
|
||||
#endif /* CMC_IMPL_HASHTABLE_SETUP */
|
||||
|
||||
#define CMC_GENERATE_MULTIMAP(PFX, SNAME, K, V) \
|
||||
CMC_GENERATE_MULTIMAP_HEADER(PFX, SNAME, K, V) \
|
||||
|
||||
+10
-5
@@ -31,15 +31,20 @@
|
||||
/* to_string format */
|
||||
static const char *cmc_string_fmt_multiset = "%s at %p { buffer:%p, capacity:%" PRIuMAX ", count:%" PRIuMAX ", cardinality:%" PRIuMAX ", load:%lf, cmp:%p, hash:%p }";
|
||||
|
||||
#ifndef CMC_HASH_TABLE_SETUP
|
||||
#define CMC_HASH_TABLE_SETUP
|
||||
#ifndef CMC_IMPL_HASHTABLE_STATE
|
||||
#define CMC_IMPL_HASHTABLE_STATE
|
||||
|
||||
typedef enum cmc_entry_state_e
|
||||
enum cmc_entry_state_e
|
||||
{
|
||||
CMC_ES_DELETED = -1,
|
||||
CMC_ES_EMPTY = 0,
|
||||
CMC_ES_FILLED = 1
|
||||
} cmc_entry_state;
|
||||
};
|
||||
|
||||
#endif /* CMC_IMPL_HASHTABLE_STATE */
|
||||
|
||||
#ifndef CMC_IMPL_HASHTABLE_SETUP
|
||||
#define CMC_IMPL_HASHTABLE_SETUP
|
||||
|
||||
static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
3067, 6143, 12289, 24571, 49157,
|
||||
@@ -73,7 +78,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531,
|
||||
6917529027641081903,
|
||||
13835058055282163729llu};
|
||||
|
||||
#endif /* CMC_HASH_TABLE_SETUP */
|
||||
#endif /* CMC_IMPL_HASHTABLE_SETUP */
|
||||
|
||||
#define CMC_GENERATE_MULTISET(PFX, SNAME, V) \
|
||||
CMC_GENERATE_MULTISET_HEADER(PFX, SNAME, V) \
|
||||
|
||||
Reference in new issue
Block a user