diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-30 01:30:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-30 01:30:18 +0400 |
commit | ce0ff266e988bf605e27ae8c393a7f74b2763d53 (patch) | |
tree | 58c5fca202e68c8d92a97255e908637ddc3ad3ee /source/blender/blenlib | |
parent | c4dd294f407fcfb12e7c1451a3aaae41b0a0114a (diff) |
GHash: generic comparison for int[4]
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index dc29a129dbf..313c4190a30 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -139,6 +139,9 @@ unsigned int BLI_ghashutil_uinthash(unsigned int key); unsigned int BLI_ghashutil_uinthash_v4(const unsigned int key[4]); #define BLI_ghashutil_inthash_v4_p \ ((GSetHashFP)BLI_ghashutil_uinthash_v4) +int BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b); +#define BLI_ghashutil_inthash_v4_cmp \ + BLI_ghashutil_uinthash_v4_cmp unsigned int BLI_ghashutil_inthash_p(const void *ptr); int BLI_ghashutil_intcmp(const void *a, const void *b); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index d24c180dae6..6b818ed36cb 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -704,6 +704,11 @@ unsigned int BLI_ghashutil_uinthash_v4(const unsigned int key[4]) return hash; } +int BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b) +{ + return memcmp(a, b, sizeof(unsigned int[4])); +} + unsigned int BLI_ghashutil_uinthash(unsigned int key) { key += ~(key << 16); |