diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenlib/BLI_smallhash.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenlib/BLI_smallhash.h')
-rw-r--r-- | source/blender/blenlib/BLI_smallhash.h | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index 80e58a98b51..083c4c411d4 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -27,42 +27,47 @@ #include "BLI_compiler_attrs.h" typedef struct { - uintptr_t key; - void *val; + uintptr_t key; + void *val; } SmallHashEntry; /* how much stack space to use before dynamically allocating memory. * set to match one of the values in 'hashsizes' to avoid too many mallocs */ #define SMSTACKSIZE 131 typedef struct SmallHash { - unsigned int nbuckets; - unsigned int nentries; - unsigned int cursize; + unsigned int nbuckets; + unsigned int nentries; + unsigned int cursize; - SmallHashEntry *buckets; - SmallHashEntry buckets_stack[SMSTACKSIZE]; + SmallHashEntry *buckets; + SmallHashEntry buckets_stack[SMSTACKSIZE]; } SmallHash; typedef struct { - const SmallHash *sh; - unsigned int i; + const SmallHash *sh; + unsigned int i; } SmallHashIter; -void BLI_smallhash_init_ex(SmallHash *sh, - const unsigned int nentries_reserve) ATTR_NONNULL(1); -void BLI_smallhash_init(SmallHash *sh) ATTR_NONNULL(1); -void BLI_smallhash_release(SmallHash *sh) ATTR_NONNULL(1); -void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1); -bool BLI_smallhash_reinsert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1); -bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); -void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); -int BLI_smallhash_len(const SmallHash *sh) ATTR_NONNULL(1); -void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void **BLI_smallhash_iternew_p(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void BLI_smallhash_init_ex(SmallHash *sh, const unsigned int nentries_reserve) ATTR_NONNULL(1); +void BLI_smallhash_init(SmallHash *sh) ATTR_NONNULL(1); +void BLI_smallhash_release(SmallHash *sh) ATTR_NONNULL(1); +void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1); +bool BLI_smallhash_reinsert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1); +bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); +void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); +int BLI_smallhash_len(const SmallHash *sh) ATTR_NONNULL(1); +void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void **BLI_smallhash_iternew_p(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; /* void BLI_smallhash_print(SmallHash *sh); */ /* UNUSED */ #ifdef DEBUG |