From ed33320e3f149f4106ed70b82d019113970c991e Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 16 May 2012 00:51:36 +0000 Subject: 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. --- source/blender/gpu/intern/gpu_codegen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 4f7fc3639f4..6a2c3eee7a5 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -232,7 +232,7 @@ static char *gpu_generate_function_prototyps(GHash *hash) GPUFunction *GPU_lookup_function(const char *name) { if (!FUNCTION_HASH) { - FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "GPU_lookup_function gh"); + FUNCTION_HASH = BLI_ghash_str_new("GPU_lookup_function gh"); gpu_parse_functions_string(FUNCTION_HASH, glsl_material_library); /*FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH); FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);*/ @@ -375,8 +375,8 @@ static void codegen_set_unique_ids(ListBase *nodes) GPUOutput *output; int id = 1, texid = 0; - bindhash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "codegen_set_unique_ids1 gh"); - definehash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "codegen_set_unique_ids2 gh"); + bindhash= BLI_ghash_ptr_new("codegen_set_unique_ids1 gh"); + definehash= BLI_ghash_ptr_new("codegen_set_unique_ids2 gh"); for (node=nodes->first; node; node=node->next) { for (input=node->inputs.first; input; input=input->next) { -- cgit v1.2.3