diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-15 08:17:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-15 08:22:36 +0400 |
commit | a7241d09cdd204a63e10a6e53c575f36639a3102 (patch) | |
tree | a436fbac1010ece84d9d15c617d5be3728469133 /source/blender/bmesh/tools/bmesh_beautify.c | |
parent | ea610e655cd8b8f9fb97f0a9a4fc5fd46418bd9e (diff) |
GHash: add typed hash functions (were all (void *))
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing.
- BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *)
This also showed up incorrect use of inthash, which was using a pointer.
Diffstat (limited to 'source/blender/bmesh/tools/bmesh_beautify.c')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_beautify.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c index b602e0742d0..b19a7d0e9b6 100644 --- a/source/blender/bmesh/tools/bmesh_beautify.c +++ b/source/blender/bmesh/tools/bmesh_beautify.c @@ -62,11 +62,11 @@ typedef struct EdRotState { static unsigned int erot_gsetutil_hash(const void *ptr) { const EdRotState *e_state = (const EdRotState *)ptr; - unsigned int - hash = BLI_ghashutil_inthash(SET_INT_IN_POINTER(e_state->v1)); - hash ^= BLI_ghashutil_inthash(SET_INT_IN_POINTER(e_state->v2)); - hash ^= BLI_ghashutil_inthash(SET_INT_IN_POINTER(e_state->f1)); - hash ^= BLI_ghashutil_inthash(SET_INT_IN_POINTER(e_state->f2)); + unsigned int hash; + hash = BLI_ghashutil_inthash(e_state->v1); + hash ^= BLI_ghashutil_inthash(e_state->v2); + hash ^= BLI_ghashutil_inthash(e_state->f1); + hash ^= BLI_ghashutil_inthash(e_state->f2); return hash; } static int erot_gsetutil_cmp(const void *a, const void *b) |