diff options
Diffstat (limited to 'source/blender/blenlib/BLI_smallhash.h')
-rw-r--r-- | source/blender/blenlib/BLI_smallhash.h | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index 275599a612c..4f5446043da 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -37,6 +37,8 @@ /* based on a doubling non-chaining approach */ +#include "BLI_compiler_attrs.h" + typedef struct { uintptr_t key; void *val; @@ -59,27 +61,15 @@ typedef struct { unsigned int i; } SmallHashIter; -#ifdef __GNUC__ -# define ATTR_NONULL_FIRST __attribute__((nonnull(1))) -# define ATTR_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -# define ATTR_NONULL_FIRST -# define ATTR_UNUSED_RESULT -#endif - - -void BLI_smallhash_init(SmallHash *hash) ATTR_NONULL_FIRST; -void BLI_smallhash_release(SmallHash *hash) ATTR_NONULL_FIRST; -void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item) ATTR_NONULL_FIRST; -void BLI_smallhash_remove(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST; -void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; -int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key) ATTR_NONULL_FIRST; -int BLI_smallhash_count(SmallHash *hash) ATTR_NONULL_FIRST; -void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; -void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key) ATTR_NONULL_FIRST ATTR_UNUSED_RESULT; +void BLI_smallhash_init(SmallHash *hash) ATTR_NONNULL(1); +void BLI_smallhash_release(SmallHash *hash) ATTR_NONNULL(1); +void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item) ATTR_NONNULL(1); +void BLI_smallhash_remove(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1); +void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1); +int BLI_smallhash_count(SmallHash *hash) ATTR_NONNULL(1); +void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; /* void BLI_smallhash_print(SmallHash *hash); */ /* UNUSED */ -#undef ATTR_NONULL_FIRST -#undef ATTR_UNUSED_RESULT - #endif /* __BLI_SMALLHASH_H__ */ |