diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 16:46:51 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 16:46:51 +0400 |
commit | 68d9e73ecd81186fe6934c48f6c26d89d788d343 (patch) | |
tree | 59a1794b3432b4c62fd90cad51127baef117c268 | |
parent | a0ce240de94521b6caf55b0738b70f2dc2ad3353 (diff) |
Fix: forgot to commit these files as part of strand bugfix.
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 02042fbfb95..b178538edf2 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -149,10 +149,10 @@ int BLI_ghashutil_intcmp (const void *a, const void *b); typedef struct GHashPair { const void *first; - int second; + const void *second; } GHashPair; -GHashPair* BLI_ghashutil_pairalloc (const void *first, int second); +GHashPair* BLI_ghashutil_pairalloc (const void *first, const void *second); unsigned int BLI_ghashutil_pairhash (const void *ptr); int BLI_ghashutil_paircmp (const void *a, const void *b); void BLI_ghashutil_pairfree (void *ptr); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 28b4794ed1b..4dba726cb61 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -305,7 +305,7 @@ int BLI_ghashutil_strcmp(const void *a, const void *b) return strcmp(a, b); } -GHashPair *BLI_ghashutil_pairalloc(const void *first, int second) +GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second) { GHashPair *pair = MEM_mallocN(sizeof(GHashPair), "GHashPair"); pair->first = first; @@ -317,7 +317,7 @@ unsigned int BLI_ghashutil_pairhash(const void *ptr) { const GHashPair *pair = ptr; unsigned int hash = BLI_ghashutil_ptrhash(pair->first); - return hash ^ BLI_ghashutil_inthash(SET_INT_IN_POINTER(pair->second)); + return hash ^ BLI_ghashutil_ptrhash(pair->second); } int BLI_ghashutil_paircmp(const void *a, const void *b) @@ -327,7 +327,7 @@ int BLI_ghashutil_paircmp(const void *a, const void *b) int cmp = BLI_ghashutil_ptrcmp(A->first, B->first); if (cmp == 0) - return BLI_ghashutil_intcmp(SET_INT_IN_POINTER(A->second), SET_INT_IN_POINTER(B->second)); + return BLI_ghashutil_ptrcmp(A->second, B->second); return cmp; } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 52d14b9d374..85735c1ac1c 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1102,7 +1102,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, if (dupli_gh) BLI_ghash_insert(dupli_gh, dob, ob); if (parent_gh) - BLI_ghash_insert(parent_gh, BLI_ghashutil_pairalloc(dob->ob, dob->index), ob); + BLI_ghash_insert(parent_gh, BLI_ghashutil_pairalloc(dob->ob, SET_INT_IN_POINTER(dob->index)), ob); } if (use_hierarchy) { @@ -1116,7 +1116,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, /* find parent that was also made real */ if (ob_src_par) { - GHashPair *pair = BLI_ghashutil_pairalloc(ob_src_par, dob->index); + GHashPair *pair = BLI_ghashutil_pairalloc(ob_src_par, SET_INT_IN_POINTER(dob->index)); ob_dst_par = BLI_ghash_lookup(parent_gh, pair); BLI_ghashutil_pairfree(pair); } |