X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhtable%2Fhtable_type.h;fp=ccan%2Fhtable%2Fhtable_type.h;h=6764c3f24ae103c8bccbcc8949c283ff56dcca1e;hp=ad3974c5e446dc74be147371d74dafb09feea631;hb=71b4e3ad90db6bacc51552438c3f6eb2a20d2631;hpb=ab244401cdba4513f3a3064c5f403fc2a59bf017 diff --git a/ccan/htable/htable_type.h b/ccan/htable/htable_type.h index ad3974c5..6764c3f2 100644 --- a/ccan/htable/htable_type.h +++ b/ccan/htable/htable_type.h @@ -2,6 +2,7 @@ #ifndef CCAN_HTABLE_TYPE_H #define CCAN_HTABLE_TYPE_H #include +#include #include "config.h" /** @@ -50,15 +51,16 @@ { \ return hashfn(keyof((const type *)elem)); \ } \ - static inline void name##_init(struct name *ht) \ + static inline UNNEEDED void name##_init(struct name *ht) \ { \ htable_init(&ht->raw, name##_hash, NULL); \ } \ - static inline void name##_init_sized(struct name *ht, size_t s) \ + static inline UNNEEDED void name##_init_sized(struct name *ht, \ + size_t s) \ { \ htable_init_sized(&ht->raw, name##_hash, NULL, s); \ } \ - static inline void name##_clear(struct name *ht) \ + static inline UNNEEDED void name##_clear(struct name *ht) \ { \ htable_clear(&ht->raw); \ } \ @@ -66,11 +68,12 @@ { \ return htable_add(&ht->raw, hashfn(keyof(elem)), elem); \ } \ - static inline bool name##_del(struct name *ht, const type *elem) \ + static inline UNNEEDED bool name##_del(struct name *ht, \ + const type *elem) \ { \ return htable_del(&ht->raw, hashfn(keyof(elem)), elem); \ } \ - static inline type *name##_get(const struct name *ht, \ + static inline UNNEEDED type *name##_get(const struct name *ht, \ const HTABLE_KTYPE(keyof) k) \ { \ /* Typecheck for eqfn */ \ @@ -81,7 +84,7 @@ (bool (*)(const void *, void *))(eqfn), \ k); \ } \ - static inline bool name##_delkey(struct name *ht, \ + static inline UNNEEDED bool name##_delkey(struct name *ht, \ const HTABLE_KTYPE(keyof) k) \ { \ type *elem = name##_get(ht, k); \ @@ -89,12 +92,12 @@ return name##_del(ht, elem); \ return false; \ } \ - static inline type *name##_first(const struct name *ht, \ + static inline UNNEEDED type *name##_first(const struct name *ht, \ struct name##_iter *iter) \ { \ return htable_first(&ht->raw, &iter->i); \ } \ - static inline type *name##_next(const struct name *ht, \ + static inline UNNEEDED type *name##_next(const struct name *ht, \ struct name##_iter *iter) \ { \ return htable_next(&ht->raw, &iter->i); \