From d5fccfb0eb2ec99fc29845082c72a5dc0a66045a Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Wed, 26 Apr 2000 08:42:19 +0000 Subject: [PATCH] Changed the 'value' parameter of g_cache_remove from gpointer to 2000-04-26 Sebastian Wilhelmi * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of g_cache_remove from gpointer to gconstpointer. Dito for the 'key' parameter of g_tree_lookup and g_tree_remove and the 'data' parameter of g_tree_serach. This function now takes a function of type GCompareFunc instead of GSearchFunc. * glib.h: Removed declaration of GSearchFunc. * gmem.c: s/GSearchFunc/GCompareFunc/. --- ChangeLog | 14 +++++++++++++- ChangeLog.pre-2-0 | 14 +++++++++++++- ChangeLog.pre-2-10 | 14 +++++++++++++- ChangeLog.pre-2-12 | 14 +++++++++++++- ChangeLog.pre-2-2 | 14 +++++++++++++- ChangeLog.pre-2-4 | 14 +++++++++++++- ChangeLog.pre-2-6 | 14 +++++++++++++- ChangeLog.pre-2-8 | 14 +++++++++++++- gcache.c | 4 ++-- glib.h | 12 +++++------- glib/gcache.c | 4 ++-- glib/glib.h | 12 +++++------- glib/gmem.c | 6 +++--- glib/gtree.c | 40 ++++++++++++++++++++-------------------- gmem.c | 6 +++--- gtree.c | 40 ++++++++++++++++++++-------------------- 16 files changed, 164 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c8bf53..2255906 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3c8bf53..2255906 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2000-04-26 Sebastian Wilhelmi + + * glib.h, gcache.c, gtree.c: Changed the 'value' parameter of + g_cache_remove from gpointer to gconstpointer. Dito for the 'key' + parameter of g_tree_lookup and g_tree_remove and the 'data' + parameter of g_tree_serach. This function now takes a function of + type GCompareFunc instead of GSearchFunc. + + * glib.h: Removed declaration of GSearchFunc. + + * gmem.c: s/GSearchFunc/GCompareFunc/. + 2000-04-19 Tor Lillqvist * glib.def: Update entry point list. @@ -5,7 +17,7 @@ 2000-04-19 Sebastian Wilhelmi * glib.h (G_TRYLOCK): Made the debugging G_TRYLOCK call also work - for compilers with funnt G_STMT_(START|END) macros. + for compilers with funny G_STMT_(START|END) macros. * tests/thread-test.c: Implemented a check for that. diff --git a/gcache.c b/gcache.c index bba7910..5e625cb 100644 --- a/gcache.c +++ b/gcache.c @@ -143,8 +143,8 @@ g_cache_insert (GCache *cache, } void -g_cache_remove (GCache *cache, - gpointer value) +g_cache_remove (GCache *cache, + gconstpointer value) { GRealCache *rcache; GCacheNode *node; diff --git a/glib.h b/glib.h index 49c8fb6..94bb61a 100644 --- a/glib.h +++ b/glib.h @@ -817,8 +817,6 @@ typedef gboolean (*GNodeTraverseFunc) (GNode *node, gpointer data); typedef void (*GNodeForeachFunc) (GNode *node, gpointer data); -typedef gint (*GSearchFunc) (gpointer key, - gpointer data); typedef void (*GScannerMsgFunc) (GScanner *scanner, gchar *message, gint error); @@ -1118,7 +1116,7 @@ void g_cache_destroy (GCache *cache); gpointer g_cache_insert (GCache *cache, gpointer key); void g_cache_remove (GCache *cache, - gpointer value); + gconstpointer value); void g_cache_key_foreach (GCache *cache, GHFunc func, gpointer user_data); @@ -1135,16 +1133,16 @@ void g_tree_insert (GTree *tree, gpointer key, gpointer value); void g_tree_remove (GTree *tree, - gpointer key); + gconstpointer key); gpointer g_tree_lookup (GTree *tree, - gpointer key); + gconstpointer key); void g_tree_traverse (GTree *tree, GTraverseFunc traverse_func, GTraverseType traverse_type, gpointer data); gpointer g_tree_search (GTree *tree, - GSearchFunc search_func, - gpointer data); + GCompareFunc search_func, + gconstpointer data); gint g_tree_height (GTree *tree); gint g_tree_nnodes (GTree *tree); diff --git a/glib/gcache.c b/glib/gcache.c index bba7910..5e625cb 100644 --- a/glib/gcache.c +++ b/glib/gcache.c @@ -143,8 +143,8 @@ g_cache_insert (GCache *cache, } void -g_cache_remove (GCache *cache, - gpointer value) +g_cache_remove (GCache *cache, + gconstpointer value) { GRealCache *rcache; GCacheNode *node; diff --git a/glib/glib.h b/glib/glib.h index 49c8fb6..94bb61a 100644 --- a/glib/glib.h +++ b/glib/glib.h @@ -817,8 +817,6 @@ typedef gboolean (*GNodeTraverseFunc) (GNode *node, gpointer data); typedef void (*GNodeForeachFunc) (GNode *node, gpointer data); -typedef gint (*GSearchFunc) (gpointer key, - gpointer data); typedef void (*GScannerMsgFunc) (GScanner *scanner, gchar *message, gint error); @@ -1118,7 +1116,7 @@ void g_cache_destroy (GCache *cache); gpointer g_cache_insert (GCache *cache, gpointer key); void g_cache_remove (GCache *cache, - gpointer value); + gconstpointer value); void g_cache_key_foreach (GCache *cache, GHFunc func, gpointer user_data); @@ -1135,16 +1133,16 @@ void g_tree_insert (GTree *tree, gpointer key, gpointer value); void g_tree_remove (GTree *tree, - gpointer key); + gconstpointer key); gpointer g_tree_lookup (GTree *tree, - gpointer key); + gconstpointer key); void g_tree_traverse (GTree *tree, GTraverseFunc traverse_func, GTraverseType traverse_type, gpointer data); gpointer g_tree_search (GTree *tree, - GSearchFunc search_func, - gpointer data); + GCompareFunc search_func, + gconstpointer data); gint g_tree_height (GTree *tree); gint g_tree_nnodes (GTree *tree); diff --git a/glib/gmem.c b/glib/gmem.c index eaa6990..4b9dfd9 100644 --- a/glib/gmem.c +++ b/glib/gmem.c @@ -576,7 +576,7 @@ g_mem_chunk_alloc (GMemChunk *mem_chunk) /* Determine which area this piece of memory is allocated from */ temp_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); /* If the area has been marked, then it is being destroyed. @@ -736,7 +736,7 @@ g_mem_chunk_free (GMemChunk *mem_chunk, rmem_chunk->free_atoms = free_atom; temp_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); temp_area->allocated -= 1; @@ -775,7 +775,7 @@ g_mem_chunk_clean (GMemChunk *mem_chunk) mem = (gpointer) temp_free_atom; mem_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); /* If this mem area is marked for destruction then delete the diff --git a/glib/gtree.c b/glib/gtree.c index c2f97de..1f29951 100644 --- a/glib/gtree.c +++ b/glib/gtree.c @@ -60,7 +60,7 @@ static GTreeNode* g_tree_node_insert (GTreeNode *node, gint *inserted); static GTreeNode* g_tree_node_remove (GTreeNode *node, GCompareFunc compare, - gpointer key); + gconstpointer key); static GTreeNode* g_tree_node_balance (GTreeNode *node); static GTreeNode* g_tree_node_remove_leftmost (GTreeNode *node, GTreeNode **leftmost); @@ -70,7 +70,7 @@ static GTreeNode* g_tree_node_restore_right_balance (GTreeNode *node, gint old_balance); static gpointer g_tree_node_lookup (GTreeNode *node, GCompareFunc compare, - gpointer key); + gconstpointer key); static gint g_tree_node_count (GTreeNode *node); static gint g_tree_node_pre_order (GTreeNode *node, GTraverseFunc traverse_func, @@ -82,8 +82,8 @@ static gint g_tree_node_post_order (GTreeNode *node, GTraverseFunc traverse_func, gpointer data); static gpointer g_tree_node_search (GTreeNode *node, - GSearchFunc search_func, - gpointer data); + GCompareFunc search_func, + gconstpointer data); static gint g_tree_node_height (GTreeNode *node); static GTreeNode* g_tree_node_rotate_left (GTreeNode *node); static GTreeNode* g_tree_node_rotate_right (GTreeNode *node); @@ -195,8 +195,8 @@ g_tree_insert (GTree *tree, } void -g_tree_remove (GTree *tree, - gpointer key) +g_tree_remove (GTree *tree, + gconstpointer key) { GRealTree *rtree; @@ -208,8 +208,8 @@ g_tree_remove (GTree *tree, } gpointer -g_tree_lookup (GTree *tree, - gpointer key) +g_tree_lookup (GTree *tree, + gconstpointer key) { GRealTree *rtree; @@ -256,9 +256,9 @@ g_tree_traverse (GTree *tree, } gpointer -g_tree_search (GTree *tree, - GSearchFunc search_func, - gpointer data) +g_tree_search (GTree *tree, + GCompareFunc search_func, + gconstpointer data) { GRealTree *rtree; @@ -371,9 +371,9 @@ g_tree_node_insert (GTreeNode *node, } static GTreeNode* -g_tree_node_remove (GTreeNode *node, - GCompareFunc compare, - gpointer key) +g_tree_node_remove (GTreeNode *node, + GCompareFunc compare, + gconstpointer key) { GTreeNode *new_root; gint old_balance; @@ -503,9 +503,9 @@ g_tree_node_restore_right_balance (GTreeNode *node, } static gpointer -g_tree_node_lookup (GTreeNode *node, - GCompareFunc compare, - gpointer key) +g_tree_node_lookup (GTreeNode *node, + GCompareFunc compare, + gconstpointer key) { gint cmp; @@ -608,9 +608,9 @@ g_tree_node_post_order (GTreeNode *node, } static gpointer -g_tree_node_search (GTreeNode *node, - GSearchFunc search_func, - gpointer data) +g_tree_node_search (GTreeNode *node, + GCompareFunc search_func, + gconstpointer data) { gint dir; diff --git a/gmem.c b/gmem.c index eaa6990..4b9dfd9 100644 --- a/gmem.c +++ b/gmem.c @@ -576,7 +576,7 @@ g_mem_chunk_alloc (GMemChunk *mem_chunk) /* Determine which area this piece of memory is allocated from */ temp_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); /* If the area has been marked, then it is being destroyed. @@ -736,7 +736,7 @@ g_mem_chunk_free (GMemChunk *mem_chunk, rmem_chunk->free_atoms = free_atom; temp_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); temp_area->allocated -= 1; @@ -775,7 +775,7 @@ g_mem_chunk_clean (GMemChunk *mem_chunk) mem = (gpointer) temp_free_atom; mem_area = g_tree_search (rmem_chunk->mem_tree, - (GSearchFunc) g_mem_chunk_area_search, + (GCompareFunc) g_mem_chunk_area_search, mem); /* If this mem area is marked for destruction then delete the diff --git a/gtree.c b/gtree.c index c2f97de..1f29951 100644 --- a/gtree.c +++ b/gtree.c @@ -60,7 +60,7 @@ static GTreeNode* g_tree_node_insert (GTreeNode *node, gint *inserted); static GTreeNode* g_tree_node_remove (GTreeNode *node, GCompareFunc compare, - gpointer key); + gconstpointer key); static GTreeNode* g_tree_node_balance (GTreeNode *node); static GTreeNode* g_tree_node_remove_leftmost (GTreeNode *node, GTreeNode **leftmost); @@ -70,7 +70,7 @@ static GTreeNode* g_tree_node_restore_right_balance (GTreeNode *node, gint old_balance); static gpointer g_tree_node_lookup (GTreeNode *node, GCompareFunc compare, - gpointer key); + gconstpointer key); static gint g_tree_node_count (GTreeNode *node); static gint g_tree_node_pre_order (GTreeNode *node, GTraverseFunc traverse_func, @@ -82,8 +82,8 @@ static gint g_tree_node_post_order (GTreeNode *node, GTraverseFunc traverse_func, gpointer data); static gpointer g_tree_node_search (GTreeNode *node, - GSearchFunc search_func, - gpointer data); + GCompareFunc search_func, + gconstpointer data); static gint g_tree_node_height (GTreeNode *node); static GTreeNode* g_tree_node_rotate_left (GTreeNode *node); static GTreeNode* g_tree_node_rotate_right (GTreeNode *node); @@ -195,8 +195,8 @@ g_tree_insert (GTree *tree, } void -g_tree_remove (GTree *tree, - gpointer key) +g_tree_remove (GTree *tree, + gconstpointer key) { GRealTree *rtree; @@ -208,8 +208,8 @@ g_tree_remove (GTree *tree, } gpointer -g_tree_lookup (GTree *tree, - gpointer key) +g_tree_lookup (GTree *tree, + gconstpointer key) { GRealTree *rtree; @@ -256,9 +256,9 @@ g_tree_traverse (GTree *tree, } gpointer -g_tree_search (GTree *tree, - GSearchFunc search_func, - gpointer data) +g_tree_search (GTree *tree, + GCompareFunc search_func, + gconstpointer data) { GRealTree *rtree; @@ -371,9 +371,9 @@ g_tree_node_insert (GTreeNode *node, } static GTreeNode* -g_tree_node_remove (GTreeNode *node, - GCompareFunc compare, - gpointer key) +g_tree_node_remove (GTreeNode *node, + GCompareFunc compare, + gconstpointer key) { GTreeNode *new_root; gint old_balance; @@ -503,9 +503,9 @@ g_tree_node_restore_right_balance (GTreeNode *node, } static gpointer -g_tree_node_lookup (GTreeNode *node, - GCompareFunc compare, - gpointer key) +g_tree_node_lookup (GTreeNode *node, + GCompareFunc compare, + gconstpointer key) { gint cmp; @@ -608,9 +608,9 @@ g_tree_node_post_order (GTreeNode *node, } static gpointer -g_tree_node_search (GTreeNode *node, - GSearchFunc search_func, - gpointer data) +g_tree_node_search (GTreeNode *node, + GCompareFunc search_func, + gconstpointer data) { gint dir; -- 2.7.4