Removed g_object_pointer_hash, which was just g_direct_hash.

Tue Jun  9 18:44:57 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkobject.c: Removed g_object_pointer_hash, which
	was just g_direct_hash.

Mon May 25 19:54:20 1998  Owen Taylor  <otaylor@gtk.org>

	* configure.in: x_libs=, not $x_libs=. Enough said.
          (Case only hit for --disable-xshm)

Mon May 25 12:08:14 1998  Owen Taylor  <otaylor@gtk.org>

	* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
	  when testing for X libraries, don't replace them. Because
	  the user might have specified the path to the X libraries
	  themself before running configure.

	* examples/**.c: Changed all gpointer * to gpointer

Sat May 23 21:54:05 1998  Owen Taylor  <otaylor@gtk.org>

	* configure.in (LDFLAGS): Bomb out with a moderately
	  helpful message if detection of X libraries fails.

Sat May 23 18:57:06 1998  Owen Taylor  <otaylor@gtk.org>

  [ Combination of:
     gtk-rrh-980412-0.patch (Raja R Harinath <harinath@cs.umn.edu>)
     gtk-jbuhler-980516-0 (Jeremy Buhler <jbuhler@cs.washington.edu>) ]

	* gdk/gdk.h gdk/gdkcc.c gdk/gdkfont.c gtk/gtkmain.c
	  gtk/gtksignal.c gtk/gtktext.c:

	  Fixups for warnings from adding const to type of GHashFunc,
	  GCompareFunc

	* gtk/gtkcombo.c (gtk_combo_entry_key_press): Minor style/
	  ansi-warnings fixups.

Tue Jun  9 17:47:33 1998  Owen Taylor  <otaylor@gtk.org>

	* glib.h: Remove #error - HP/UX.

Sat May 23 19:00:01 1998  Owen Taylor  <otaylor@gtk.org>
  [ Combination of:
     gtk-rrh-980412-0.patch (Raja R Harinath <harinath@cs.umn.edu>)
     gtk-jbuhler-980516-0 (Jeremy Buhler <jbuhler@cs.washington.edu>) ]

	* glib.h ghash.c gstring.c gdataset.c gutils.c:
	- Added new typedef g_const_pointer; expunged all incorrect
	  uses of 'const gpointer'.
	- Fixed up warnings that that created,
	- Changed GHashFunc and GCompareFunc to take g_const_pointer
	  arguments. (Necessary, but will cause warnings in existing
	  code until fixed)
	- Added other new const in harmless positions.
This commit is contained in:
Owen Taylor 1998-06-09 23:18:11 +00:00 committed by Owen Taylor
parent a1fe6d0337
commit 2cabeeb1c3
40 changed files with 309 additions and 157 deletions

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -1,3 +1,22 @@
Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkobject.c: Removed g_object_pointer_hash, which
was just g_direct_hash.
Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
* configure.in: x_libs=, not $x_libs=. Enough said.
(Case only hit for --disable-xshm)
Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
when testing for X libraries, don't replace them. Because
the user might have specified the path to the X libraries
themself before running configure.
* examples/**.c: Changed all gpointer * to gpointer
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
@ -265,7 +284,7 @@ Sun May 24 12:11:38 BST 1998 Tony Gale <gale@gtk.org>
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
* configure.in (LDFLAGS): Bombo out with a moderately
* configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>

View File

@ -140,8 +140,8 @@ fi
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
CFLAGS="$X_CFLAGS"
LDFLAGS="$X_LDFLAGS $X_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
if test "x$no_x" = "xyes"; then
AC_MSG_ERROR([
@ -170,7 +170,7 @@ fi
AC_CHECK_LIB(Xext, XShapeCombineMask,
if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
$x_libs="-lXext $x_libs"
x_libs="-lXext $x_libs"
fi
AC_DEFINE(HAVE_SHAPE_EXT),
,

View File

@ -46,7 +46,7 @@ GtkWidget *xpm_label_box (GtkWidget *parent, gchar *xpm_filename, gchar *label_t
}
/* our usual callback function */
void callback (GtkWidget *widget, gpointer *data)
void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}

View File

@ -10,7 +10,7 @@ void file_ok_sel (GtkWidget *w, GtkFileSelection *fs)
g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
}
void destroy (GtkWidget *widget, gpointer *data)
void destroy (GtkWidget *widget, gpointer data)
{
gtk_main_quit ();
}

View File

@ -6,13 +6,13 @@
/* Our new improved callback. The data passed to this function is printed
* to stdout. */
void callback (GtkWidget *widget, gpointer *data)
void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
/* another callback */
void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
void delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}

View File

@ -36,7 +36,7 @@ void remove_book (GtkButton *button, GtkNotebook *notebook)
gtk_widget_draw(GTK_WIDGET(notebook), NULL);
}
void delete (GtkWidget *widget, GdkEvent *event, gpointer *data)
void delete (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}

View File

@ -5,7 +5,7 @@
#include "gtk/gtk.h"
void
delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}

View File

@ -31,14 +31,15 @@ static const char * xpm_data[] = {
/* when invoked (via signal delete_event), terminates the application.
*/
void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
{
gtk_main_quit();
}
/* is invoked when the button is clicked. It just prints a message.
*/
void button_clicked( GtkWidget *widget, gpointer *data ) {
void button_clicked( GtkWidget *widget, gpointer data ) {
printf( "button clicked\n" );
}

View File

@ -33,7 +33,7 @@ void progress_r (void)
pstat = FALSE;
}
void destroy (GtkWidget *widget, GdkEvent *event, gpointer *data)
void destroy (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}

View File

@ -5,7 +5,8 @@
#include <gtk/gtk.h>
#include <glib.h>
void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
{
gtk_main_quit();
}

View File

@ -11,7 +11,8 @@
/* this routine gets control when the close button is clicked
*/
void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
{
gtk_main_quit();
}

View File

@ -4,7 +4,7 @@
#include <gtk/gtk.h>
void destroy(GtkWidget *widget, gpointer *data)
void destroy(GtkWidget *widget, gpointer data)
{
gtk_main_quit();
}

View File

@ -7,7 +7,7 @@
GtkWidget *status_bar;
void push_item (GtkWidget *widget, gpointer *data)
void push_item (GtkWidget *widget, gpointer data)
{
static int count = 1;
char buff[20];
@ -18,7 +18,7 @@ void push_item (GtkWidget *widget, gpointer *data)
return;
}
void pop_item (GtkWidget *widget, gpointer *data)
void pop_item (GtkWidget *widget, gpointer data)
{
gtk_statusbar_pop( GTK_STATUSBAR(status_bar), (guint) &data );
return;

View File

@ -5,13 +5,13 @@
/* our callback.
* the data passed to this function is printed to stdout */
void callback (GtkWidget *widget, gpointer *data)
void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
/* this callback quits the program */
void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
void delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}

View File

@ -123,7 +123,7 @@ static char * WheelbarrowFull_xpm[] = {
/* when invoked (via signal delete_event), terminates the application.
*/
void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
void close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) {
gtk_main_quit();
}

View File

@ -490,9 +490,9 @@ GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (gchar *fontset_name);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
gint gdk_font_id (GdkFont *font);
gint gdk_font_equal (GdkFont *fonta,
GdkFont *fontb);
gint gdk_font_id (const GdkFont *font);
gint gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
const gchar *string);
gint gdk_text_width (GdkFont *font,

View File

@ -66,19 +66,19 @@
static guint
hash_color (gpointer key)
hash_color (g_const_pointer key)
{
GdkColor *color = key;
const GdkColor *color = key;
return (color->red * 33023 + color->green * 30013 + color->blue * 27011);
}
static gint
compare_colors (gpointer a,
gpointer b)
compare_colors (g_const_pointer a,
g_const_pointer b)
{
GdkColor *aa = a;
GdkColor *bb = b;
const GdkColor *aa = a;
const GdkColor *bb = b;
return ((aa->red == bb->red) && (aa->green == bb->green) && (aa->blue == bb->blue));
}

View File

@ -149,13 +149,13 @@ gdk_font_unref (GdkFont *font)
}
gint
gdk_font_id (GdkFont *font)
gdk_font_id (const GdkFont *font)
{
GdkFontPrivate *font_private;
const GdkFontPrivate *font_private;
g_return_val_if_fail (font != NULL, 0);
font_private = (GdkFontPrivate*) font;
font_private = (const GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
@ -168,17 +168,17 @@ gdk_font_id (GdkFont *font)
}
gint
gdk_font_equal (GdkFont *fonta,
GdkFont *fontb)
gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb)
{
GdkFontPrivate *privatea;
GdkFontPrivate *privateb;
const GdkFontPrivate *privatea;
const GdkFontPrivate *privateb;
g_return_val_if_fail (fonta != NULL, FALSE);
g_return_val_if_fail (fontb != NULL, FALSE);
privatea = (GdkFontPrivate*) fonta;
privateb = (GdkFontPrivate*) fontb;
privatea = (const GdkFontPrivate*) fonta;
privateb = (const GdkFontPrivate*) fontb;
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
{

View File

@ -66,19 +66,19 @@
static guint
hash_color (gpointer key)
hash_color (g_const_pointer key)
{
GdkColor *color = key;
const GdkColor *color = key;
return (color->red * 33023 + color->green * 30013 + color->blue * 27011);
}
static gint
compare_colors (gpointer a,
gpointer b)
compare_colors (g_const_pointer a,
g_const_pointer b)
{
GdkColor *aa = a;
GdkColor *bb = b;
const GdkColor *aa = a;
const GdkColor *bb = b;
return ((aa->red == bb->red) && (aa->green == bb->green) && (aa->blue == bb->blue));
}

View File

@ -149,13 +149,13 @@ gdk_font_unref (GdkFont *font)
}
gint
gdk_font_id (GdkFont *font)
gdk_font_id (const GdkFont *font)
{
GdkFontPrivate *font_private;
const GdkFontPrivate *font_private;
g_return_val_if_fail (font != NULL, 0);
font_private = (GdkFontPrivate*) font;
font_private = (const GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
@ -168,17 +168,17 @@ gdk_font_id (GdkFont *font)
}
gint
gdk_font_equal (GdkFont *fonta,
GdkFont *fontb)
gdk_font_equal (const GdkFont *fonta,
const GdkFont *fontb)
{
GdkFontPrivate *privatea;
GdkFontPrivate *privateb;
const GdkFontPrivate *privatea;
const GdkFontPrivate *privateb;
g_return_val_if_fail (fonta != NULL, FALSE);
g_return_val_if_fail (fontb != NULL, FALSE);
privatea = (GdkFontPrivate*) fonta;
privateb = (GdkFontPrivate*) fontb;
privatea = (const GdkFontPrivate*) fonta;
privateb = (const GdkFontPrivate*) fontb;
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
{

View File

@ -1,3 +1,21 @@
Tue Jun 9 17:47:33 1998 Owen Taylor <otaylor@gtk.org>
* glib.h: Remove #error - HP/UX.
Sat May 23 19:00:01 1998 Owen Taylor <otaylor@gtk.org>
[ Combination of:
gtk-rrh-980412-0.patch (Raja R Harinath <harinath@cs.umn.edu>)
gtk-jbuhler-980516-0 (Jeremy Buhler <jbuhler@cs.washington.edu>) ]
* glib.h ghash.c gstring.c gdataset.c gutils.c:
- Added new typedef g_const_pointer; expunged all incorrect
uses of 'const gpointer'.
- Fixed up warnings that that created,
- Changed GHashFunc and GCompareFunc to take g_const_pointer
arguments. (Necessary, but will cause warnings in existing
code until fixed)
- Added other new const in harmless positions.
Mon Jun 8 01:06:47 1998 Tim Janik <timj@gtk.org>
* glib.h: added enum-helper macros for code generation.

View File

@ -38,16 +38,17 @@ struct _GDatasetData
gpointer data;
GDestroyNotify destroy_func;
};
struct _GDataset
{
gpointer location;
g_const_pointer location;
GDatasetData *data_list;
};
/* --- prototypes --- */
static inline GDataset* g_dataset_lookup (const gpointer dataset_location);
static inline void g_dataset_destroy_i (GDataset *dataset);
static inline GDataset* g_dataset_lookup (g_const_pointer dataset_location);
static inline void g_dataset_destroy_i (GDataset *dataset);
static void g_dataset_initialize (void);
static guint* g_dataset_id_new (void);
@ -64,7 +65,7 @@ static guint g_dataset_id_index = G_DATASET_ID_BLOCK_SIZE + 1;
/* --- functions --- */
static inline GDataset*
g_dataset_lookup (const gpointer dataset_location)
g_dataset_lookup (g_const_pointer dataset_location)
{
register GDataset *dataset;
@ -108,7 +109,7 @@ g_dataset_destroy_i (GDataset *dataset)
}
void
g_dataset_destroy (const gpointer dataset_location)
g_dataset_destroy (g_const_pointer dataset_location)
{
register GDataset *dataset;
@ -120,9 +121,9 @@ g_dataset_destroy (const gpointer dataset_location)
}
void
g_dataset_id_set_destroy (const gpointer dataset_location,
guint key_id,
GDestroyNotify destroy_func)
g_dataset_id_set_destroy (g_const_pointer dataset_location,
guint key_id,
GDestroyNotify destroy_func)
{
g_return_if_fail (dataset_location != NULL);
@ -149,8 +150,8 @@ g_dataset_id_set_destroy (const gpointer dataset_location,
}
gpointer
g_dataset_id_get_data (const gpointer dataset_location,
guint key_id)
g_dataset_id_get_data (g_const_pointer dataset_location,
guint key_id)
{
g_return_val_if_fail (dataset_location != NULL, NULL);
@ -173,10 +174,10 @@ g_dataset_id_get_data (const gpointer dataset_location,
}
void
g_dataset_id_set_data_full (const gpointer dataset_location,
guint key_id,
gpointer data,
GDestroyNotify destroy_func)
g_dataset_id_set_data_full (g_const_pointer dataset_location,
guint key_id,
gpointer data,
GDestroyNotify destroy_func)
{
register GDataset *dataset;
register GDatasetData *list;
@ -190,7 +191,9 @@ g_dataset_id_set_data_full (const gpointer dataset_location,
dataset = g_chunk_new (GDataset, g_dataset_mem_chunk);
dataset->location = dataset_location;
dataset->data_list = NULL;
g_hash_table_insert (g_dataset_location_ht, dataset->location, dataset);
g_hash_table_insert (g_dataset_location_ht,
(gpointer) dataset->location, /* Yuck */
dataset);
}
list = dataset->data_list;

View File

@ -145,8 +145,8 @@ g_hash_table_insert (GHashTable *hash_table,
}
void
g_hash_table_remove (GHashTable *hash_table,
gpointer key)
g_hash_table_remove (GHashTable *hash_table,
g_const_pointer key)
{
GRealHashTable *rhash_table;
GHashNode *node;
@ -187,7 +187,7 @@ g_hash_table_remove (GHashTable *hash_table,
gpointer
g_hash_table_lookup (GHashTable *hash_table,
const gpointer key)
g_const_pointer key)
{
GRealHashTable *rhash_table;
GHashNode *node;

View File

@ -389,6 +389,7 @@ typedef double gldouble;
#endif /* 0 */
typedef void* gpointer;
typedef const void *g_const_pointer;
#if (SIZEOF_CHAR == 1)
typedef signed char gint8;
@ -429,7 +430,7 @@ typedef unsigned long guint32;
#define GUINT_TO_POINTER(u) ((gpointer)(gulong)(u))
#else
#error "No integer type of the same size as a pointer"
/* This should never happen */
#endif
@ -455,9 +456,6 @@ typedef void (*GFunc) (gpointer data,
typedef void (*GHFunc) (gpointer key,
gpointer value,
gpointer user_data);
typedef guint (*GHashFunc) (gpointer key);
typedef gint (*GCompareFunc) (gpointer a,
gpointer b);
typedef gpointer (*GCacheNewFunc) (gpointer key);
typedef gpointer (*GCacheDupFunc) (gpointer value);
typedef void (*GCacheDestroyFunc) (gpointer value);
@ -474,6 +472,9 @@ typedef void (*GScannerMsgFunc) (GScanner *scanner,
gint error);
typedef void (*GDestroyNotify) (gpointer data);
typedef guint (*GHashFunc) (g_const_pointer key);
typedef gint (*GCompareFunc) (g_const_pointer a,
g_const_pointer b);
struct _GList
{
@ -623,12 +624,12 @@ GHashTable* g_hash_table_new (GHashFunc hash_func,
GCompareFunc key_compare_func);
void g_hash_table_destroy (GHashTable *hash_table);
void g_hash_table_insert (GHashTable *hash_table,
gpointer key,
gpointer value);
gpointer key,
gpointer value);
void g_hash_table_remove (GHashTable *hash_table,
gpointer key);
g_const_pointer key);
gpointer g_hash_table_lookup (GHashTable *hash_table,
const gpointer key);
g_const_pointer key);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table,
@ -892,29 +893,29 @@ GArray* g_rarray_truncate (GArray *array,
/* Hash Functions
*/
gint g_str_equal (const gpointer v,
const gpointer v2);
guint g_str_hash (const gpointer v);
gint g_str_equal (g_const_pointer v,
g_const_pointer v2);
guint g_str_hash (g_const_pointer v);
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
* simple integer values.
*/
guint g_direct_hash (gpointer key);
guint g_direct_hash (g_const_pointer key);
/* Location Associated Data
*/
void g_dataset_destroy (const gpointer dataset_location);
void g_dataset_destroy (g_const_pointer dataset_location);
guint g_dataset_try_key (const gchar *key);
guint g_dataset_force_id (const gchar *key);
gpointer g_dataset_id_get_data (const gpointer dataset_location,
gpointer g_dataset_id_get_data (g_const_pointer dataset_location,
guint key_id);
void g_dataset_id_set_data_full (const gpointer dataset_location,
void g_dataset_id_set_data_full (g_const_pointer dataset_location,
guint key_id,
gpointer data,
GDestroyNotify destroy_func);
void g_dataset_id_set_destroy (const gpointer dataset_location,
void g_dataset_id_set_destroy (g_const_pointer dataset_location,
guint key_id,
GDestroyNotify destroy_func);

View File

@ -401,7 +401,7 @@ g_scanner_foreach_internal (gpointer key,
register gpointer *d;
d = user_data;
func = d[0];
func = (GHFunc)d[0];
func_data = d[1];
hash_val = value;
@ -417,7 +417,7 @@ g_scanner_foreach_symbol (GScanner *scanner,
g_return_if_fail (scanner != NULL);
d[0] = func;
d[0] = (gpointer)func;
d[1] = func_data;
g_hash_table_foreach (scanner->symbol_table, g_scanner_foreach_internal, d);

View File

@ -50,17 +50,17 @@ static GMemChunk *string_mem_chunk = NULL;
*/
gint
g_str_equal (const gpointer v, const gpointer v2)
g_str_equal (g_const_pointer v, g_const_pointer v2)
{
return strcmp ((gchar*) v, (gchar*)v2) == 0;
return strcmp ((const gchar*) v, (const gchar*)v2) == 0;
}
/* a char* hash function from ASU */
guint
g_str_hash (const gpointer v)
g_str_hash (g_const_pointer v)
{
char *s = (char*)v;
char *p;
const char *s = (char*)v;
const char *p;
guint h=0, g;
for(p = s; *p != '\0'; p += 1) {

View File

@ -847,7 +847,7 @@ g_parse_debug_string (const gchar *string,
}
guint
g_direct_hash(gpointer key)
g_direct_hash(g_const_pointer key)
{
return GPOINTER_TO_UINT (key);
}

View File

@ -33,31 +33,31 @@ my_hash_callback (gpointer key,
}
guint
my_hash (gpointer key)
my_hash (g_const_pointer key)
{
return (guint) *((gint*) key);
return (guint) *((const gint*) key);
}
gint
my_hash_compare (gpointer a,
gpointer b)
my_hash_compare (g_const_pointer a,
g_const_pointer b)
{
return *((gint*) a) == *((gint*) b);
return *((const gint*) a) == *((const gint*) b);
}
gint
my_list_compare_one (gpointer a, gpointer b)
my_list_compare_one (g_const_pointer a, g_const_pointer b)
{
gint one = *((gint*)a);
gint two = *((gint*)b);
gint one = *((const gint*)a);
gint two = *((const gint*)b);
return one-two;
}
gint
my_list_compare_two (gpointer a, gpointer b)
my_list_compare_two (g_const_pointer a, g_const_pointer b)
{
gint one = *((gint*)a);
gint two = *((gint*)b);
gint one = *((const gint*)a);
gint two = *((const gint*)b);
return two-one;
}
@ -69,11 +69,11 @@ my_list_print (gpointer a, gpointer b)
}; */
gint
my_compare (gpointer a,
gpointer b)
my_compare (g_const_pointer a,
g_const_pointer b)
{
char *cha = a;
char *chb = b;
const char *cha = a;
const char *chb = b;
return *cha - *chb;
}

View File

@ -57,11 +57,11 @@ static GMemChunk *accel_entries_mem_chunk = NULL;
/* --- functions --- */
static gint
gtk_accel_entries_equal (gpointer a,
gpointer b)
gtk_accel_entries_equal (g_const_pointer a,
g_const_pointer b)
{
GtkAccelEntry *e1;
GtkAccelEntry *e2;
const GtkAccelEntry *e1;
const GtkAccelEntry *e2;
e1 = a;
e2 = b;
@ -72,9 +72,9 @@ gtk_accel_entries_equal (gpointer a,
}
static guint
gtk_accel_entries_hash (gpointer a)
gtk_accel_entries_hash (g_const_pointer a)
{
GtkAccelEntry *e;
const GtkAccelEntry *e;
guint h;
e = a;

View File

@ -118,11 +118,12 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com
GList *li;
/* completion */
if ( event->keyval == GDK_Tab ) {
if (event->keyval == GDK_Tab)
{
GCompletion * cmpl;
gchar* prefix;
gchar* nprefix = NULL;
guint pos;
gint pos;
gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event");
cmpl = g_completion_new((GCompletionFunc)gtk_combo_func);
@ -130,9 +131,10 @@ gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * com
pos = GTK_EDITABLE(entry)->current_pos;
prefix = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, pos);
g_completion_complete(cmpl, prefix, &nprefix);
if ( nprefix && strlen(nprefix) > strlen(prefix) ) {
if (nprefix && strlen(nprefix) > strlen(prefix))
{
gtk_editable_insert_text(GTK_EDITABLE(entry), nprefix+pos,
strlen(nprefix)-strlen(prefix), &pos);
strlen(nprefix)-strlen(prefix), &pos);
GTK_EDITABLE(entry)->current_pos = pos;
}
g_free(prefix);

View File

@ -128,11 +128,11 @@ static gint gtk_timeout_remove_from_list (GList **list,
guint tag,
gint remove_link);
static gint gtk_idle_compare (gpointer a,
gpointer b);
static gint gtk_idle_compare (g_const_pointer a,
g_const_pointer b);
static gint gtk_timeout_compare (gpointer a,
gpointer b);
static gint gtk_timeout_compare (g_const_pointer a,
g_const_pointer b);
const guint gtk_major_version = GTK_MAJOR_VERSION;
const guint gtk_minor_version = GTK_MINOR_VERSION;
@ -997,9 +997,10 @@ gtk_timeout_remove (guint tag)
* sure that we insert at the _end_ of the idles of this priority
*/
static gint
gtk_idle_compare (gpointer a, gpointer b)
gtk_idle_compare (g_const_pointer a, g_const_pointer b)
{
return (((GtkIdleFunction *)a)->priority < ((GtkIdleFunction *)b)->priority)
return (((const GtkIdleFunction *)a)->priority <
((const GtkIdleFunction *)b)->priority)
? -1 : 1;
}
@ -1365,10 +1366,10 @@ gtk_exit_func (void)
* sure that we insert after timeouts of equal interval
*/
static gint
gtk_timeout_compare (gpointer a, gpointer b)
gtk_timeout_compare (g_const_pointer a, g_const_pointer b)
{
return (((GtkTimeoutFunction *)a)->interval <
((GtkTimeoutFunction *)b)->interval)
return (((const GtkTimeoutFunction *)a)->interval <
((const GtkTimeoutFunction *)b)->interval)
? -1 : 1;
}

View File

@ -120,15 +120,6 @@ gtk_object_debug (void)
g_print ("GTK-DEBUG: living objects count = %d\n", obj_count);
}
static guint
gtk_object_pointer_hash (const gpointer v)
{
gint i;
i = (gint) v;
return i;
}
#endif /* G_ENABLE_DEBUG */
/****************************************************
@ -215,7 +206,7 @@ gtk_object_init (GtkObject *object)
obj_count++;
if (!living_objs_ht)
living_objs_ht = g_hash_table_new (gtk_object_pointer_hash, NULL);
living_objs_ht = g_hash_table_new (g_direct_hash, NULL);
g_hash_table_insert (living_objs_ht, object, object);
}

View File

@ -119,9 +119,9 @@ struct _GtkDisconnectInfo
};
static guint gtk_signal_hash (const gpointer h);
static gint gtk_signal_compare (const gpointer h1,
const gpointer h2);
static guint gtk_signal_hash (g_const_pointer h);
static gint gtk_signal_compare (g_const_pointer h1,
g_const_pointer h2);
static GtkHandler* gtk_signal_handler_new (void);
static void gtk_signal_handler_ref (GtkHandler *handler);
static void gtk_signal_handler_unref (GtkHandler *handler,
@ -1186,19 +1186,19 @@ gtk_signal_set_funcs (GtkSignalMarshal marshal_func,
}
static guint
gtk_signal_hash (const gpointer h)
gtk_signal_hash (g_const_pointer h)
{
register GtkSignalHash *hash = h;
register const GtkSignalHash *hash = h;
return hash->object_type ^ hash->name_key_id;
}
static gint
gtk_signal_compare (const gpointer h1,
const gpointer h2)
gtk_signal_compare (g_const_pointer h1,
g_const_pointer h2)
{
register GtkSignalHash *hash1 = h1;
register GtkSignalHash *hash2 = h2;
register const GtkSignalHash *hash1 = h1;
register const GtkSignalHash *hash2 = h2;
return (hash1->name_key_id == hash2->name_key_id &&
hash1->object_type == hash2->object_type);

View File

@ -2495,9 +2495,9 @@ insert_expose (GtkText* text, guint old_pixels, gint nchars,
}
static guint
font_hash (gpointer font)
font_hash (g_const_pointer font)
{
return gdk_font_id ((GdkFont*) font);
return gdk_font_id ((const GdkFont*) font);
}
static TextFont*