Changed the 'value' parameter of g_cache_remove from gpointer to

2000-04-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* 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/.
This commit is contained in:
Sebastian Wilhelmi 2000-04-26 08:42:19 +00:00 committed by Sebastian Wilhelmi
parent 7e3c98f8e9
commit d5fccfb0eb
16 changed files with 164 additions and 72 deletions

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -1,3 +1,15 @@
2000-04-26 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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 <tml@iki.fi>
* glib.def: Update entry point list.
@ -5,7 +17,7 @@
2000-04-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* 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.

View File

@ -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;

12
glib.h
View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;

6
gmem.c
View File

@ -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

40
gtree.c
View File

@ -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;