diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
commit | 9e365069afe156f33fadfad9705e1325f894cd54 (patch) | |
tree | 78373044d029feb51f987b45208e0c1a36958625 /source/blender/blenlib/intern/BLI_ghash_utils.c | |
parent | d8b42751625c915113b64f5a2d9c72f19f009fee (diff) |
Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash_utils.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash_utils.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c index b9144009304..f8e621e406c 100644 --- a/source/blender/blenlib/intern/BLI_ghash_utils.c +++ b/source/blender/blenlib/intern/BLI_ghash_utils.c @@ -46,9 +46,10 @@ uint BLI_ghashutil_ptrhash(const void *key) return (uint)(intptr_t)key; } #else -/* Based Python3.7's pointer hashing function. */ uint BLI_ghashutil_ptrhash(const void *key) { + /* Based Python3.7's pointer hashing function. */ + size_t y = (size_t)key; /* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid * excessive hash collisions for dicts and sets */ @@ -134,15 +135,6 @@ size_t BLI_ghashutil_combine_hash(size_t hash_a, size_t hash_b) return hash_a ^ (hash_b + 0x9e3779b9 + (hash_a << 6) + (hash_a >> 2)); } -/** - * This function implements the widely used "djb" hash apparently posted - * by Daniel Bernstein to comp.lang.c some time ago. The 32 bit - * unsigned hash value starts at 5381 and for each byte 'c' in the - * string, is updated: `hash = hash * 33 + c`. - * This function uses the signed value of each byte. - * - * NOTE: this is the same hash method that glib 2.34.0 uses. - */ uint BLI_ghashutil_strhash_n(const char *key, size_t n) { const signed char *p; |