aboutsummaryrefslogtreecommitdiff
path: root/lib/cbit/htab.h
diff options
context:
space:
mode:
authorcomex2015-03-01 13:20:08 -0500
committercomex2015-03-01 13:20:08 -0500
commit471eb472dbd3462b6a5ab21f85621e16c411709b (patch)
tree1e682ade28b4a49ab8894a19c5205b59d1e73cc9 /lib/cbit/htab.h
parentAdd extra argument to substitute_hook_functions and interpose_imports for use... (diff)
downloadsubstitute-471eb472dbd3462b6a5ab21f85621e16c411709b.tar.gz
add vec
Diffstat (limited to 'lib/cbit/htab.h')
-rw-r--r--lib/cbit/htab.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/cbit/htab.h b/lib/cbit/htab.h
index 5c9b993..ccb40b9 100644
--- a/lib/cbit/htab.h
+++ b/lib/cbit/htab.h
@@ -12,8 +12,6 @@ struct htab_internal {
char hi_storage[1]; // see vec.h
};
-#define UNUSED_STATIC_INLINE __attribute__((unused)) static inline
-
/* Declare the helper functions for a htab key type without static - put this
* in the .h and IMPL_HTAB_KEY in a .c. */
#define DECL_EXTERN_HTAB_KEY( \
@@ -188,7 +186,6 @@ struct htab_internal {
}; \
htab_ty { \
union { \
- char h[0]; \
struct htab_internal hi; \
struct { \
size_t length; \
@@ -273,11 +270,13 @@ struct htab_internal {
} while (0)
#define HTAB_FOREACH(ht, key_var, val_var, name) \
- LET(struct htab_##name *__ht = (ht)) \
- for (size_t __htfe_bucket = 0; __htfe_bucket < __ht->capacity; __htfe_bucket++) \
- if(__htab_is_null_##name(&__ht->base[__htfe_bucket].key)) \
+ LET(struct htab_##name *__htfe_ht = (ht)) \
+ for (size_t __htfe_bucket = 0; \
+ __htfe_bucket < __htfe_ht->capacity; \
+ __htfe_bucket++) \
+ if(__htab_is_null_##name(&__htfe_ht->base[__htfe_bucket].key)) \
continue; \
else \
- LET_LOOP(key_var = &__ht->base[__htfe_bucket].key) \
- LET_LOOP(val_var = &__ht->base[__htfe_bucket].value)
+ LET_LOOP(key_var = &__htfe_ht->base[__htfe_bucket].key) \
+ LET_LOOP(val_var = &__htfe_ht->base[__htfe_bucket].value)