renamed g_string_equal => g_str_equal renamed g_string_hash => g_str_hash

Sat Jan 17 23:52:40 1998  Owen Taylor  <owt1@cornell.edu>

	* gstring.{c,h} gscanner.c:
	   renamed g_string_equal => g_str_equal
	   renamed g_string_hash => g_str_hash
	  And const corrected. Old functions left in for now.
This commit is contained in:
Owen Taylor 1998-01-18 15:12:01 +00:00 committed by Owen Taylor
parent 11d37c5067
commit 4628759d3b
11 changed files with 152 additions and 84 deletions

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,23 +1,28 @@
Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu> Sun Jan 18 09:57:00 1998 Owen Taylor <owt1@cornell.edu>
* gtkbutton.c gtkclist.c gtkdrawingarea.c gtkentry.c gtkeventbox.c
gtkfixed.c gtkhandlebox.c gtkhscale.c gtkhscrollbar.c gtkitem.c
gtklist.c gtkmenushell.c gtkmisc.c gtknotebook.c gtkpaned.c
gtkpreview.c gtkprogressbar.c gtkruler.c gtktext.c gtktree.c
gtkviewport.c gtkvscale.c gtkvscrollbar.c gtkwidget.{c,h}
Added gtk_widget_set_parent and gtk_widget_get_parent. All * gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkdrawingarea.c
widgets should use: gtk/gtkentry.c gtk/gtkeventbox.c gtk/gtkfixed.c
gtk/gtkhandlebox.c gtk/gtkhscale.c gtk/gtkhscrollbar.c
gtk/gtkitem.c gtk/gtklist.c gtk/gtkmenushell.c gtk/gtkmisc.c
gtk/gtknotebook.c gtk/gtkpaned.c gtk/gtkpreview.c
gtk/gtkprogressbar.c gtk/gtkruler.c gtk/gtktext.c gtk/gtktree.c
gtk/gtkviewport.c gtk/gtkvscale.c gtk/gtkvscrollbar.c
gtk/gtkwidget.{c,h}
Added gtk_widget_set_parent_window() and
gtk_widget_get_parent_window(). All widgets should use:
gtk_widget_get_parent_window() instead of widget->parent->window.
gtk_widget_get_parent() instead of widget->parent->window.
Any widget that wants to have children not in the parent window, Any widget that wants to have children not in the parent window,
should use gtk_widget_set_parent () in their realize() and should use gtk_widget_set_parent() in their realize() and
add () routines. add() routines.
CList and Viewport widgets changed to do this. (Viewport CList and Viewport widgets changed to do this. (Viewport
widget using code from gtk-fortier-980117-0.patch.) widget using code from gtk-fortier-980117-0.patch.)
Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu> Sat Jan 17 23:56:02 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkobject.c: * gtk/gtkobject.c:
renamed g_string_equal => g_str_equal renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash renamed g_string_hash => g_str_hash

View File

@ -1,3 +1,10 @@
Sat Jan 17 23:52:40 1998 Owen Taylor <owt1@cornell.edu>
* gstring.{c,h} gscanner.c:
renamed g_string_equal => g_str_equal
renamed g_string_hash => g_str_hash
And const corrected. Old functions left in for now.
Fri Jan 9 20:03:46 1998 Tim Janik <timj@psynet.net> Fri Jan 9 20:03:46 1998 Tim Janik <timj@psynet.net>
* gutils.c (g_strerror): changed message for EAGAIN from * gutils.c (g_strerror): changed message for EAGAIN from

View File

@ -191,7 +191,7 @@ g_scanner_new (GScannerConfig *config_templ)
scanner->next_line = 1; scanner->next_line = 1;
scanner->next_position = 0; scanner->next_position = 0;
scanner->symbol_table = g_hash_table_new (g_string_hash, g_string_equal); scanner->symbol_table = g_hash_table_new (g_str_hash, g_str_equal);
scanner->text = NULL; scanner->text = NULL;
scanner->text_len = 0; scanner->text_len = 0;
scanner->input_fd = -1; scanner->input_fd = -1;

View File

@ -47,16 +47,42 @@ static GMemChunk *string_mem_chunk = NULL;
/* Hash Functions. /* Hash Functions.
*/ */
/* Pete, you may have these elsewhere. */
gint gint
g_string_equal(gpointer v, gpointer v2) g_str_equal (const gpointer v, const gpointer v2)
{ {
return strcmp ((gchar*) v, (gchar*)v2) == 0; return strcmp ((gchar*) v, (gchar*)v2) == 0;
} }
/* a char* hash function from ASU */ /* a char* hash function from ASU */
guint guint
g_string_hash(gpointer v) g_str_hash (const gpointer v)
{
char *s = (char*)v;
char *p;
guint h=0, g;
for(p = s; *p != '\0'; p += 1) {
h = ( h << 4 ) + *p;
if ( ( g = h & 0xf0000000 ) ) {
h = h ^ (g >> 24);
h = h ^ g;
}
}
return h /* % M */;
}
/* Deprecated, use g_str_* ... */
gint
g_string_equal (gpointer v, gpointer v2)
{
return strcmp ((gchar*) v, (gchar*)v2) == 0;
}
/* a char* hash function from ASU */
guint
g_string_hash (gpointer v)
{ {
char *s = (char*)v; char *s = (char*)v;
char *p; char *p;
@ -161,7 +187,7 @@ g_string_chunk_insert_const (GStringChunk *fchunk,
char* lookup; char* lookup;
if (!chunk->const_table) if (!chunk->const_table)
chunk->const_table = g_hash_table_new (g_string_hash, g_string_equal); chunk->const_table = g_hash_table_new (g_str_hash, g_str_equal);
lookup = (char*) g_hash_table_lookup (chunk->const_table, string); lookup = (char*) g_hash_table_lookup (chunk->const_table, string);

View File

@ -632,7 +632,7 @@ gtk_object_add_arg_type (const char *arg_name,
info->arg_id = arg_id; info->arg_id = arg_id;
if (!arg_info_ht) if (!arg_info_ht)
arg_info_ht = g_hash_table_new (g_string_hash, g_string_equal); arg_info_ht = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (arg_info_ht, info->name, info); g_hash_table_insert (arg_info_ht, info->name, info);
} }
@ -966,7 +966,7 @@ gtk_object_data_init ()
{ {
object_data_init = FALSE; object_data_init = FALSE;
object_data_ht = g_hash_table_new (g_string_hash, g_string_equal); object_data_ht = g_hash_table_new (g_str_hash, g_str_equal);
} }
} }