summaryrefslogtreecommitdiff
path: root/gcache.c
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-10-30 14:34:52 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-10-30 14:34:52 +0000
commit267b6813703e24ef60d0e8ba42557c414f9dd52e (patch)
tree555ac313ee58d9ea4f7a68855d16ee6c485e54bf /gcache.c
parentd42361a6e3d60fc6b926eae47a7aed85dedfd397 (diff)
downloadglib-267b6813703e24ef60d0e8ba42557c414f9dd52e.tar.gz
Introduced new function type GEqualFunc to return TRUE for equal params.
2000-10-30 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gcache.h, gcache.c, ghash.h, ghash.c, grel.c, grel.h, gtypes.h: Introduced new function type GEqualFunc to return TRUE for equal params. This is now used instead of GCompareFunc (which should work akin to strcmp) here. This kind of fixes Bug #14412. Note that technically GCompareFunc and GEqualFunc are still the same types, as gint == gboolean. * ghash.h, gutils.c: g_int_equal and g_direct_equal now return gboolean to be really become GEqualFunc. * gscanner.c, testglib.c, tests/hash-test.c: Some tiny changes to follow the above change.
Diffstat (limited to 'gcache.c')
-rw-r--r--gcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcache.c b/gcache.c
index 1b5518efe..5a06e0eeb 100644
--- a/gcache.c
+++ b/gcache.c
@@ -77,7 +77,7 @@ g_cache_new (GCacheNewFunc value_new_func,
GCacheDestroyFunc key_destroy_func,
GHashFunc hash_key_func,
GHashFunc hash_value_func,
- GCompareFunc key_compare_func)
+ GEqualFunc key_equal_func)
{
GRealCache *cache;
@@ -87,14 +87,14 @@ g_cache_new (GCacheNewFunc value_new_func,
g_return_val_if_fail (key_destroy_func != NULL, NULL);
g_return_val_if_fail (hash_key_func != NULL, NULL);
g_return_val_if_fail (hash_value_func != NULL, NULL);
- g_return_val_if_fail (key_compare_func != NULL, NULL);
+ g_return_val_if_fail (key_equal_func != NULL, NULL);
cache = g_new (GRealCache, 1);
cache->value_new_func = value_new_func;
cache->value_destroy_func = value_destroy_func;
cache->key_dup_func = key_dup_func;
cache->key_destroy_func = key_destroy_func;
- cache->key_table = g_hash_table_new (hash_key_func, key_compare_func);
+ cache->key_table = g_hash_table_new (hash_key_func, key_equal_func);
cache->value_table = g_hash_table_new (hash_value_func, NULL);
return (GCache*) cache;