diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-16 04:51:36 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-05-16 04:51:36 +0400 |
commit | ed33320e3f149f4106ed70b82d019113970c991e (patch) | |
tree | 49aaa5a8f7e53e7065fb758c86c73eddc20d3b9f /source/blender/render | |
parent | eb22b5248229494bcab091e68cf7a354fe0cc0e3 (diff) |
Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.
GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);
Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/sss.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/strand.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index f16c1b5e673..c2b0e1e777f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -902,7 +902,7 @@ static float *get_object_orco(Render *re, Object *ob) float *orco; if (!re->orco_hash) - re->orco_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "get_object_orco gh"); + re->orco_hash = BLI_ghash_ptr_new("get_object_orco gh"); orco = BLI_ghash_lookup(re->orco_hash, ob); @@ -924,7 +924,7 @@ static float *get_object_orco(Render *re, Object *ob) static void set_object_orco(Render *re, void *ob, float *orco) { if (!re->orco_hash) - re->orco_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "set_object_orco gh"); + re->orco_hash = BLI_ghash_ptr_new("set_object_orco gh"); BLI_ghash_insert(re->orco_hash, ob, orco); } diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c index c8a37998169..690598d8c05 100644 --- a/source/blender/render/intern/source/sss.c +++ b/source/blender/render/intern/source/sss.c @@ -990,7 +990,7 @@ void make_sss_tree(Render *re) { Material *mat; - re->sss_hash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "make_sss_tree gh"); + re->sss_hash= BLI_ghash_ptr_new("make_sss_tree gh"); re->i.infostr= "SSS preprocessing"; re->stats_draw(re->sdh, &re->i); diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index 6690425967c..02d342754ea 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -333,8 +333,8 @@ StrandShadeCache *strand_shade_cache_create(void) StrandShadeCache *cache; cache= MEM_callocN(sizeof(StrandShadeCache), "StrandShadeCache"); - cache->resulthash= BLI_ghash_new(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, "strand_shade_cache_create1 gh"); - cache->refcounthash= BLI_ghash_new(BLI_ghashutil_pairhash, BLI_ghashutil_paircmp, "strand_shade_cache_create2 gh"); + cache->resulthash= BLI_ghash_pair_new("strand_shade_cache_create1 gh"); + cache->refcounthash= BLI_ghash_pair_new("strand_shade_cache_create2 gh"); cache->memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, "strand shade cache arena"); return cache; |