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/windowmanager/intern/wm.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 7285e155dc6..a34d294461c 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -183,7 +183,7 @@ void WM_menutype_freelink(MenuType *mt) /* called on initialize WM_init() */ void WM_menutype_init(void) { - menutypes_hash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh"); + menutypes_hash = BLI_ghash_str_new("menutypes_hash gh"); } void WM_menutype_free(void) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index c18625c0168..7f3a93258da 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3740,7 +3740,7 @@ void wm_operatortype_free(void) /* called on initialize WM_init() */ void wm_operatortype_init(void) { - global_ops_hash = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wm_operatortype_init gh"); + global_ops_hash = BLI_ghash_str_new("wm_operatortype_init gh"); WM_operatortype_append(WM_OT_window_duplicate); WM_operatortype_append(WM_OT_read_homefile); -- cgit v1.2.3