diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-07-19 08:44:37 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-07-19 08:44:37 +0400 |
commit | c11c196efadf5ef52293d782638497f86a209722 (patch) | |
tree | 43abcd60b2400d28db8686f4dbea68f17475ef58 /source/blender/blenlib/intern/BLI_ghash.c | |
parent | f54aa7811029c90b6071ccc9e27e57a758e5884d (diff) | |
parent | 7f083c45bee15f7540e2a35a725efe28fc962239 (diff) |
part 1 of merge from trunk at r30358; it compiles, but doesn't link quite yet :)
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 6ef8d9e5f19..456872d6612 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -28,21 +28,10 @@ * A general (pointer -> pointer) hash table ADT */ -#include <stdlib.h> -#include <string.h> -#include "MEM_guardedalloc.h" #include "BLI_ghash.h" -#include "BLI_mempool.h" - #include "BLO_sys_types.h" // for intptr_t support -#include "BKE_utildefines.h" - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /***/ unsigned int hashsizes[]= { @@ -56,8 +45,8 @@ unsigned int hashsizes[]= { /***/ -GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp) { - GHash *gh= MEM_mallocN(sizeof(*gh), "GHash"); +GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) { + GHash *gh= MEM_mallocN(sizeof(*gh), info); gh->hashfp= hashfp; gh->cmpfp= cmpfp; gh->entrypool = BLI_mempool_create(sizeof(Entry), 64, 64, 1, 0); @@ -145,7 +134,7 @@ void *BLI_ghashIterator_getValue(GHashIterator *ghi) { void BLI_ghashIterator_step(GHashIterator *ghi) { if (ghi->curEntry) { - ghi->curEntry= ghi->curEntry->next; + ghi->curEntry= ghi->curEntry->next; while (!ghi->curEntry) { ghi->curBucket++; if (ghi->curBucket==ghi->gh->nbuckets) @@ -180,7 +169,7 @@ unsigned int BLI_ghashutil_inthash(void *ptr) { key += ~(key << 9); key ^= (key >> 17); - return (unsigned int)(key & 0xffffffff); + return (unsigned int)(key & 0xffffffff); } int BLI_ghashutil_intcmp(void *a, void *b) { |