Commit 84114c53 authored by Sebastian Wilhelmi's avatar Sebastian Wilhelmi Committed by Sebastian Wilhelmi

Mark the functions g_hash_table_freeze, g_hash_table_thaw and thus


2000-07-20  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* ghash.c, gscanner.c, glib.h: Mark the functions
	g_hash_table_freeze, g_hash_table_thaw and thus
	g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
	deprecated. They will issue an warning once, when compiled with
	G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
	http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
parent 5e4c5611
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
2000-07-20 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* ghash.c, gscanner.c, glib.h: Mark the functions
g_hash_table_freeze, g_hash_table_thaw and thus
g_scanner_freeze_symbol_table and g_scanner_thaw_symbol_table
deprecated. They will issue an warning once, when compiled with
G_ENABLE_DEBUG. This fixes Bug #3883. For discussion see
http://mail.gnome.org/pipermail/gtk-devel-list/2000-April/003139.html
2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-07-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, glib.h: glibconfig.h and glib.h now include files * configure.in, glib.h: glibconfig.h and glib.h now include files
......
...@@ -48,7 +48,6 @@ struct _GHashTable ...@@ -48,7 +48,6 @@ struct _GHashTable
{ {
gint size; gint size;
gint nnodes; gint nnodes;
guint frozen;
GHashNode **nodes; GHashNode **nodes;
GHashFunc hash_func; GHashFunc hash_func;
GCompareFunc key_compare_func; GCompareFunc key_compare_func;
...@@ -80,7 +79,6 @@ g_hash_table_new (GHashFunc hash_func, ...@@ -80,7 +79,6 @@ g_hash_table_new (GHashFunc hash_func,
hash_table = g_new (GHashTable, 1); hash_table = g_new (GHashTable, 1);
hash_table->size = HASH_TABLE_MIN_SIZE; hash_table->size = HASH_TABLE_MIN_SIZE;
hash_table->nnodes = 0; hash_table->nnodes = 0;
hash_table->frozen = FALSE;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash; hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
hash_table->key_compare_func = key_compare_func; hash_table->key_compare_func = key_compare_func;
hash_table->nodes = g_new (GHashNode*, hash_table->size); hash_table->nodes = g_new (GHashNode*, hash_table->size);
...@@ -167,7 +165,6 @@ g_hash_table_insert (GHashTable *hash_table, ...@@ -167,7 +165,6 @@ g_hash_table_insert (GHashTable *hash_table,
{ {
*node = g_hash_node_new (key, value); *node = g_hash_node_new (key, value);
hash_table->nnodes++; hash_table->nnodes++;
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
} }
} }
...@@ -189,7 +186,6 @@ g_hash_table_remove (GHashTable *hash_table, ...@@ -189,7 +186,6 @@ g_hash_table_remove (GHashTable *hash_table,
g_hash_node_destroy (dest); g_hash_node_destroy (dest);
hash_table->nnodes--; hash_table->nnodes--;
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
} }
} }
...@@ -221,19 +217,20 @@ g_hash_table_lookup_extended (GHashTable *hash_table, ...@@ -221,19 +217,20 @@ g_hash_table_lookup_extended (GHashTable *hash_table,
void void
g_hash_table_freeze (GHashTable *hash_table) g_hash_table_freeze (GHashTable *hash_table)
{ {
g_return_if_fail (hash_table != NULL); #ifdef G_ENABLE_DEBUG
static gboolean first_call = TRUE;
hash_table->frozen++; if (first_call)
{
g_warning("g_hash_table_freeze and g_hash_table_thaw are deprecated.");
first_call = FALSE;
}
#endif /* G_ENABLE_DEBUG */
} }
void void
g_hash_table_thaw (GHashTable *hash_table) g_hash_table_thaw (GHashTable *hash_table)
{ {
g_return_if_fail (hash_table != NULL);
if (hash_table->frozen)
if (!(--hash_table->frozen))
g_hash_table_resize (hash_table);
} }
guint guint
...@@ -278,7 +275,6 @@ g_hash_table_foreach_remove (GHashTable *hash_table, ...@@ -278,7 +275,6 @@ g_hash_table_foreach_remove (GHashTable *hash_table,
} }
} }
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
return deleted; return deleted;
......
...@@ -1114,8 +1114,6 @@ gboolean g_hash_table_lookup_extended(GHashTable *hash_table, ...@@ -1114,8 +1114,6 @@ gboolean g_hash_table_lookup_extended(GHashTable *hash_table,
gconstpointer lookup_key, gconstpointer lookup_key,
gpointer *orig_key, gpointer *orig_key,
gpointer *value); gpointer *value);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table, void g_hash_table_foreach (GHashTable *hash_table,
GHFunc func, GHFunc func,
gpointer user_data); gpointer user_data);
...@@ -1124,6 +1122,10 @@ guint g_hash_table_foreach_remove (GHashTable *hash_table, ...@@ -1124,6 +1122,10 @@ guint g_hash_table_foreach_remove (GHashTable *hash_table,
gpointer user_data); gpointer user_data);
guint g_hash_table_size (GHashTable *hash_table); guint g_hash_table_size (GHashTable *hash_table);
/* The following two functions are deprecated and will be removed in
* the next major release. They do no good. */
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
/* Caches /* Caches
*/ */
...@@ -2272,8 +2274,6 @@ void g_scanner_scope_foreach_symbol (GScanner *scanner, ...@@ -2272,8 +2274,6 @@ void g_scanner_scope_foreach_symbol (GScanner *scanner,
gpointer user_data); gpointer user_data);
gpointer g_scanner_lookup_symbol (GScanner *scanner, gpointer g_scanner_lookup_symbol (GScanner *scanner,
const gchar *symbol); const gchar *symbol);
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
void g_scanner_unexp_token (GScanner *scanner, void g_scanner_unexp_token (GScanner *scanner,
GTokenType expected_token, GTokenType expected_token,
const gchar *identifier_spec, const gchar *identifier_spec,
...@@ -2299,6 +2299,10 @@ gint g_scanner_stat_mode (const gchar *filename); ...@@ -2299,6 +2299,10 @@ gint g_scanner_stat_mode (const gchar *filename);
g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \ g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \
} G_STMT_END } G_STMT_END
/* The following two functions are deprecated and will be removed in
* the next major release. They do no good. */
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
/* GCompletion /* GCompletion
*/ */
......
...@@ -48,7 +48,6 @@ struct _GHashTable ...@@ -48,7 +48,6 @@ struct _GHashTable
{ {
gint size; gint size;
gint nnodes; gint nnodes;
guint frozen;
GHashNode **nodes; GHashNode **nodes;
GHashFunc hash_func; GHashFunc hash_func;
GCompareFunc key_compare_func; GCompareFunc key_compare_func;
...@@ -80,7 +79,6 @@ g_hash_table_new (GHashFunc hash_func, ...@@ -80,7 +79,6 @@ g_hash_table_new (GHashFunc hash_func,
hash_table = g_new (GHashTable, 1); hash_table = g_new (GHashTable, 1);
hash_table->size = HASH_TABLE_MIN_SIZE; hash_table->size = HASH_TABLE_MIN_SIZE;
hash_table->nnodes = 0; hash_table->nnodes = 0;
hash_table->frozen = FALSE;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash; hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
hash_table->key_compare_func = key_compare_func; hash_table->key_compare_func = key_compare_func;
hash_table->nodes = g_new (GHashNode*, hash_table->size); hash_table->nodes = g_new (GHashNode*, hash_table->size);
...@@ -167,7 +165,6 @@ g_hash_table_insert (GHashTable *hash_table, ...@@ -167,7 +165,6 @@ g_hash_table_insert (GHashTable *hash_table,
{ {
*node = g_hash_node_new (key, value); *node = g_hash_node_new (key, value);
hash_table->nnodes++; hash_table->nnodes++;
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
} }
} }
...@@ -189,7 +186,6 @@ g_hash_table_remove (GHashTable *hash_table, ...@@ -189,7 +186,6 @@ g_hash_table_remove (GHashTable *hash_table,
g_hash_node_destroy (dest); g_hash_node_destroy (dest);
hash_table->nnodes--; hash_table->nnodes--;
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
} }
} }
...@@ -221,19 +217,20 @@ g_hash_table_lookup_extended (GHashTable *hash_table, ...@@ -221,19 +217,20 @@ g_hash_table_lookup_extended (GHashTable *hash_table,
void void
g_hash_table_freeze (GHashTable *hash_table) g_hash_table_freeze (GHashTable *hash_table)
{ {
g_return_if_fail (hash_table != NULL); #ifdef G_ENABLE_DEBUG
static gboolean first_call = TRUE;
hash_table->frozen++; if (first_call)
{
g_warning("g_hash_table_freeze and g_hash_table_thaw are deprecated.");
first_call = FALSE;
}
#endif /* G_ENABLE_DEBUG */
} }
void void
g_hash_table_thaw (GHashTable *hash_table) g_hash_table_thaw (GHashTable *hash_table)
{ {
g_return_if_fail (hash_table != NULL);
if (hash_table->frozen)
if (!(--hash_table->frozen))
g_hash_table_resize (hash_table);
} }
guint guint
...@@ -278,7 +275,6 @@ g_hash_table_foreach_remove (GHashTable *hash_table, ...@@ -278,7 +275,6 @@ g_hash_table_foreach_remove (GHashTable *hash_table,
} }
} }
if (!hash_table->frozen)
g_hash_table_resize (hash_table); g_hash_table_resize (hash_table);
return deleted; return deleted;
......
...@@ -1114,8 +1114,6 @@ gboolean g_hash_table_lookup_extended(GHashTable *hash_table, ...@@ -1114,8 +1114,6 @@ gboolean g_hash_table_lookup_extended(GHashTable *hash_table,
gconstpointer lookup_key, gconstpointer lookup_key,
gpointer *orig_key, gpointer *orig_key,
gpointer *value); gpointer *value);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table, void g_hash_table_foreach (GHashTable *hash_table,
GHFunc func, GHFunc func,
gpointer user_data); gpointer user_data);
...@@ -1124,6 +1122,10 @@ guint g_hash_table_foreach_remove (GHashTable *hash_table, ...@@ -1124,6 +1122,10 @@ guint g_hash_table_foreach_remove (GHashTable *hash_table,
gpointer user_data); gpointer user_data);
guint g_hash_table_size (GHashTable *hash_table); guint g_hash_table_size (GHashTable *hash_table);
/* The following two functions are deprecated and will be removed in
* the next major release. They do no good. */
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
/* Caches /* Caches
*/ */
...@@ -2272,8 +2274,6 @@ void g_scanner_scope_foreach_symbol (GScanner *scanner, ...@@ -2272,8 +2274,6 @@ void g_scanner_scope_foreach_symbol (GScanner *scanner,
gpointer user_data); gpointer user_data);
gpointer g_scanner_lookup_symbol (GScanner *scanner, gpointer g_scanner_lookup_symbol (GScanner *scanner,
const gchar *symbol); const gchar *symbol);
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
void g_scanner_unexp_token (GScanner *scanner, void g_scanner_unexp_token (GScanner *scanner,
GTokenType expected_token, GTokenType expected_token,
const gchar *identifier_spec, const gchar *identifier_spec,
...@@ -2299,6 +2299,10 @@ gint g_scanner_stat_mode (const gchar *filename); ...@@ -2299,6 +2299,10 @@ gint g_scanner_stat_mode (const gchar *filename);
g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \ g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \
} G_STMT_END } G_STMT_END
/* The following two functions are deprecated and will be removed in
* the next major release. They do no good. */
void g_scanner_freeze_symbol_table (GScanner *scanner);
void g_scanner_thaw_symbol_table (GScanner *scanner);
/* GCompletion /* GCompletion
*/ */
......
...@@ -565,17 +565,21 @@ g_scanner_scope_foreach_symbol (GScanner *scanner, ...@@ -565,17 +565,21 @@ g_scanner_scope_foreach_symbol (GScanner *scanner,
void void
g_scanner_freeze_symbol_table (GScanner *scanner) g_scanner_freeze_symbol_table (GScanner *scanner)
{ {
g_return_if_fail (scanner != NULL); #ifdef G_ENABLE_DEBUG
static gboolean first_call = TRUE;
g_hash_table_freeze (scanner->symbol_table); if (first_call)
{
g_warning("g_scanner_freeze_symbol_table and "
"g_scanner_thaw_symbol_table are deprecated.");
first_call = FALSE;
}
#endif /* G_ENABLE_DEBUG */
} }
void void
g_scanner_thaw_symbol_table (GScanner *scanner) g_scanner_thaw_symbol_table (GScanner *scanner)
{ {
g_return_if_fail (scanner != NULL);
g_hash_table_thaw (scanner->symbol_table);
} }
GTokenType GTokenType
......
...@@ -565,17 +565,21 @@ g_scanner_scope_foreach_symbol (GScanner *scanner, ...@@ -565,17 +565,21 @@ g_scanner_scope_foreach_symbol (GScanner *scanner,
void void
g_scanner_freeze_symbol_table (GScanner *scanner) g_scanner_freeze_symbol_table (GScanner *scanner)
{ {
g_return_if_fail (scanner != NULL); #ifdef G_ENABLE_DEBUG
static gboolean first_call = TRUE;
g_hash_table_freeze (scanner->symbol_table); if (first_call)
{
g_warning("g_scanner_freeze_symbol_table and "
"g_scanner_thaw_symbol_table are deprecated.");
first_call = FALSE;
}
#endif /* G_ENABLE_DEBUG */
} }
void void
g_scanner_thaw_symbol_table (GScanner *scanner) g_scanner_thaw_symbol_table (GScanner *scanner)
{ {
g_return_if_fail (scanner != NULL);
g_hash_table_thaw (scanner->symbol_table);
} }
GTokenType GTokenType
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment