From 8acfd1e9de927adf2bea546bda55740a2b0cc436 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 20 Mar 2002 21:47:01 +0000 Subject: [PATCH] Patch from Erwann Chenede, #73900 fixing a lot of warnings with Forte CC, Wed Mar 20 16:36:08 2002 Owen Taylor * gtk/*.c: Patch from Erwann Chenede, #73900 fixing a lot of warnings with Forte CC, mostly implicit casts between void * and function pointers. * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's state field is not a GdkModifierType. (Also #73900) --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gdk-pixbuf/gdk-pixbuf-io.c | 2 +- gdk/gdkevents.c | 2 -- gdk/x11/gdkpixmap-x11.c | 3 ++- gtk/gtkaccellabel.c | 4 ++-- gtk/gtkaccelmap.c | 5 +++-- gtk/gtkcontainer.c | 4 ++-- gtk/gtkentry.c | 2 +- gtk/gtkimmulticontext.c | 8 ++++---- gtk/gtkmain.c | 7 ++++--- gtk/gtkmenubar.c | 2 +- gtk/gtksettings.c | 7 +++---- gtk/gtksignal.c | 6 +++--- gtk/gtkspinbutton.c | 2 -- gtk/gtktextview.c | 10 ++++++---- gtk/gtktreemodel.c | 6 +++--- gtk/gtktreeview.c | 10 +++++----- gtk/gtkwidget.c | 6 +++--- gtk/gtkwindow.c | 2 +- 24 files changed, 98 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0a69f04244..b4d61c8470 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Wed Mar 20 16:36:08 2002 Owen Taylor + + * gtk/*.c: Patch from Erwann Chenede, #73900 fixing + a lot of warnings with Forte CC, mostly implicit + casts between void * and function pointers. + + * gdk/gdkevents.c (gdk_event_get_state): GdkEventVisibility's + state field is not a GdkModifierType. (Also #73900) + Wed Mar 20 12:35:22 2002 Owen Taylor * gtk/gtkwidget.c (gtk_widget_grab_default): Remove diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 13e02f6f0e..597d4ddabc 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -363,7 +363,7 @@ _gdk_pixbuf_load_module (GdkPixbufModule *image_module, image_module->module = module; if (pixbuf_module_symbol (module, name, "fill_vtable", &sym)) { - ModuleFillVtableFunc func = sym; + ModuleFillVtableFunc func = (ModuleFillVtableFunc) sym; (* func) (image_module); retval = TRUE; } else { diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 137ef78e89..700ac797d2 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -516,8 +516,6 @@ gdk_event_get_state (GdkEvent *event, *state = event->property.state; return TRUE; case GDK_VISIBILITY_NOTIFY: - *state = event->visibility.state; - return TRUE; case GDK_CLIENT_EVENT: case GDK_NO_EXPOSE: case GDK_CONFIGURE: diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index ae50cc3375..78674816ea 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -314,7 +314,8 @@ gdk_pixmap_foreign_new (GdkNativeWindow anid) GdkPixmapImplX11 *pix_impl; Pixmap xpixmap; Window root_return; - unsigned int x_ret, y_ret, w_ret, h_ret, bw_ret, depth_ret; + int x_ret, y_ret; + unsigned int w_ret, h_ret, bw_ret, depth_ret; /* check to make sure we were passed something at least a little sane */ diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index e81de1067a..291f58aa3d 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -388,7 +388,7 @@ gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label, { gtk_accel_label_set_accel_closure (accel_label, NULL); g_signal_handlers_disconnect_by_func (accel_label->accel_widget, - G_CALLBACK (refetch_widget_accel_closure), + (gpointer) refetch_widget_accel_closure, accel_label); g_object_unref (accel_label->accel_widget); } @@ -448,7 +448,7 @@ gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label, if (accel_label->accel_closure) { g_signal_handlers_disconnect_by_func (accel_label->accel_group, - G_CALLBACK (check_accel_changed), + (gpointer) check_accel_changed, accel_label); accel_label->accel_group = NULL; g_closure_unref (accel_label->accel_closure); diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c index 9942381f8a..3bafd1ce4e 100644 --- a/gtk/gtkaccelmap.c +++ b/gtk/gtkaccelmap.c @@ -457,7 +457,7 @@ accel_map_parse_statement (GScanner *scanner) { guint (*parser_func) (GScanner*); - parser_func = scanner->value.v_symbol; + parser_func = (guint (*) (GScanner *))scanner->value.v_symbol; expected_token = parser_func (scanner); } @@ -512,7 +512,8 @@ gtk_accel_map_load_scanner (GScanner *scanner) symbol_2_token = scanner->config->symbol_2_token; scanner->config->symbol_2_token = FALSE; saved_symbol = g_scanner_lookup_symbol (scanner, "gtk_accel_path"); - g_scanner_scope_add_symbol (scanner, 0, "gtk_accel_path", accel_map_parse_accel_path); + g_scanner_scope_add_symbol (scanner, 0, "gtk_accel_path", + (gpointer) accel_map_parse_accel_path); /* outer parsing loop */ diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 1a7d0a1139..bef2491cbb 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1916,7 +1916,7 @@ chain_widget_destroyed (GtkWidget *widget, chain = g_list_remove (chain, widget); g_signal_handlers_disconnect_by_func (G_OBJECT (widget), - chain_widget_destroyed, + (gpointer) chain_widget_destroyed, user_data); g_object_set_data (G_OBJECT (container), @@ -2043,7 +2043,7 @@ gtk_container_unset_focus_chain (GtkContainer *container) while (tmp_list != NULL) { g_signal_handlers_disconnect_by_func (G_OBJECT (tmp_list->data), - chain_widget_destroyed, + (gpointer) chain_widget_destroyed, container); tmp_list = g_list_next (tmp_list); diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index c9d6d18fc2..9ef6c6e887 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1585,7 +1585,7 @@ gtk_entry_focus_out (GtkWidget *widget, gtk_entry_check_cursor_blink (entry); g_signal_handlers_disconnect_by_func (gdk_keymap_get_default (), - gtk_entry_keymap_direction_changed, + (gpointer) gtk_entry_keymap_direction_changed, entry); return FALSE; diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index 446a51f78a..20796f1e73 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -163,16 +163,16 @@ gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext, gtk_im_context_reset (multicontext->slave); g_signal_handlers_disconnect_by_func (multicontext->slave, - gtk_im_multicontext_preedit_start_cb, + (gpointer) gtk_im_multicontext_preedit_start_cb, multicontext); g_signal_handlers_disconnect_by_func (multicontext->slave, - gtk_im_multicontext_preedit_end_cb, + (gpointer) gtk_im_multicontext_preedit_end_cb, multicontext); g_signal_handlers_disconnect_by_func (multicontext->slave, - gtk_im_multicontext_preedit_changed_cb, + (gpointer) gtk_im_multicontext_preedit_changed_cb, multicontext); g_signal_handlers_disconnect_by_func (multicontext->slave, - gtk_im_multicontext_commit_cb, + (gpointer) gtk_im_multicontext_commit_cb, multicontext); g_object_unref (multicontext->slave); diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index e6396498ad..11bbe873f0 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -489,10 +489,11 @@ load_module (GSList *gtk_modules, g_module_symbol (module, "gtk_module_init", (gpointer *) &modinit_func) && modinit_func) { - if (!g_slist_find (gtk_modules, modinit_func)) + if (!g_slist_find (gtk_modules, (gconstpointer) modinit_func)) { g_module_make_resident (module); - gtk_modules = g_slist_prepend (gtk_modules, modinit_func); + gtk_modules = g_slist_prepend (gtk_modules, + (gpointer) modinit_func); } else { @@ -762,7 +763,7 @@ gtk_init_check (int *argc, { GtkModuleInitFunc modinit; - modinit = slist->data; + modinit = (GtkModuleInitFunc) slist->data; modinit (argc, argv); } } diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index fa351abd58..fc45328df1 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -466,7 +466,7 @@ remove_from_window (GtkWindow *window, if (!menubars) { g_signal_handlers_disconnect_by_func (G_OBJECT (window), - G_CALLBACK (window_key_press_handler), + (gpointer) window_key_press_handler, NULL); } diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 1547f6a529..f5f02eea0c 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -319,8 +319,7 @@ gtk_settings_get_property (GObject *object, { GValue tmp_value = { 0, }; GValue gstring_value = { 0, }; - GtkRcPropertyParser parser = g_param_spec_get_qdata (pspec, - quark_property_parser); + GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser); g_value_init (&gstring_value, G_TYPE_GSTRING); @@ -448,7 +447,7 @@ apply_queued_setting (GtkSettings *data, GtkSettingsValue *qvalue) { GValue tmp_value = { 0, }; - GtkRcPropertyParser parser = g_param_spec_get_qdata (pspec, quark_property_parser); + GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser); g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); if (_gtk_settings_parse_convert (parser, &qvalue->value, @@ -508,7 +507,7 @@ settings_install_property_parser (GtkSettingsClass *class, g_object_freeze_notify (node->data); g_object_class_install_property (G_OBJECT_CLASS (class), ++class_n_properties, pspec); - g_param_spec_set_qdata (pspec, quark_property_parser, parser); + g_param_spec_set_qdata (pspec, quark_property_parser, (gpointer) parser); for (node = object_list; node; node = node->next) { diff --git a/gtk/gtksignal.c b/gtk/gtksignal.c index 380ad51e34..9ee26ad358 100644 --- a/gtk/gtksignal.c +++ b/gtk/gtksignal.c @@ -163,9 +163,9 @@ gtk_signal_compat_matched (GtkObject *object, switch (action) { - case 0: n_handlers = g_signal_handlers_disconnect_matched (object, match, 0, 0, NULL, func, data); break; - case 1: n_handlers = g_signal_handlers_block_matched (object, match, 0, 0, NULL, func, data); break; - case 2: n_handlers = g_signal_handlers_unblock_matched (object, match, 0, 0, NULL, func, data); break; + case 0: n_handlers = g_signal_handlers_disconnect_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; + case 1: n_handlers = g_signal_handlers_block_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; + case 2: n_handlers = g_signal_handlers_unblock_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; default: n_handlers = 0; break; } diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index ae1a0208af..8642b271bf 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1117,8 +1117,6 @@ gtk_spin_button_button_release (GtkWidget *widget, } else return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event); - - return FALSE; } static gint diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 771bdcb42c..cfbe6e9b1a 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1087,7 +1087,7 @@ gtk_text_view_set_buffer (GtkTextView *text_view, g_slist_free (copy); g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->buffer), - gtk_text_view_mark_set_handler, text_view); + (gpointer) gtk_text_view_mark_set_handler, text_view); g_object_unref (G_OBJECT (text_view->buffer)); text_view->dnd_mark = NULL; @@ -3921,7 +3921,7 @@ gtk_text_view_focus_out_event (GtkWidget *widget, GdkEventFocus *event) } g_signal_handlers_disconnect_by_func (gdk_keymap_get_default (), - keymap_direction_changed, + (gpointer) keymap_direction_changed, text_view); text_view->need_im_reset = TRUE; @@ -5307,9 +5307,11 @@ gtk_text_view_destroy_layout (GtkTextView *text_view) gtk_text_view_end_selection_drag (text_view, NULL); g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->layout), - invalidated_handler, text_view); + (gpointer) invalidated_handler, + text_view); g_signal_handlers_disconnect_by_func (G_OBJECT (text_view->layout), - changed_handler, text_view); + (gpointer) changed_handler, + text_view); g_object_unref (G_OBJECT (text_view->layout)); text_view->layout = NULL; } diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 94c763a206..b03824c143 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -1492,17 +1492,17 @@ disconnect_ref_callbacks (GtkTreeModel *model) g_signal_handlers_disconnect_matched (G_OBJECT (model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, - gtk_tree_row_ref_inserted_callback, + (gpointer) gtk_tree_row_ref_inserted_callback, NULL); g_signal_handlers_disconnect_matched (G_OBJECT (model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, - gtk_tree_row_ref_deleted_callback, + (gpointer) gtk_tree_row_ref_deleted_callback, NULL); g_signal_handlers_disconnect_matched (G_OBJECT (model), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, - gtk_tree_row_ref_reordered_callback, + (gpointer) gtk_tree_row_ref_reordered_callback, NULL); } diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 2e281eefa9..ec51a0b05e 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -7425,15 +7425,15 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, gtk_tree_view_unref_and_check_selection_tree (tree_view, tree_view->priv->tree); g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - gtk_tree_view_row_changed, tree_view); + (gpointer) gtk_tree_view_row_changed, tree_view); g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - gtk_tree_view_row_inserted, tree_view); + (gpointer) gtk_tree_view_row_inserted, tree_view); g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - gtk_tree_view_row_has_child_toggled, tree_view); + (gpointer) gtk_tree_view_row_has_child_toggled, tree_view); g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - gtk_tree_view_row_deleted, tree_view); + (gpointer) gtk_tree_view_row_deleted, tree_view); g_signal_handlers_disconnect_by_func (G_OBJECT (tree_view->priv->model), - gtk_tree_view_rows_reordered, tree_view); + (gpointer) gtk_tree_view_rows_reordered, tree_view); if (tree_view->priv->tree) { _gtk_rbtree_free (tree_view->priv->tree); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 35ae74d9fd..8a91b0ac3e 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -6070,7 +6070,7 @@ gtk_widget_class_install_style_property_parser (GtkWidgetClass *class, g_param_spec_ref (pspec); g_param_spec_sink (pspec); - g_param_spec_set_qdata (pspec, quark_property_parser, parser); + g_param_spec_set_qdata (pspec, quark_property_parser, (gpointer) parser); g_param_spec_pool_insert (style_property_spec_pool, pspec, G_OBJECT_CLASS_TYPE (class)); } @@ -6124,7 +6124,7 @@ gtk_widget_style_get_property (GtkWidget *widget, peek_value = _gtk_style_peek_property_value (widget->style, G_OBJECT_TYPE (widget), pspec, - g_param_spec_get_qdata (pspec, quark_property_parser)); + (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser)); /* auto-conversion of the caller's value type */ @@ -6187,7 +6187,7 @@ gtk_widget_style_get_valist (GtkWidget *widget, peek_value = _gtk_style_peek_property_value (widget->style, G_OBJECT_TYPE (widget), pspec, - g_param_spec_get_qdata (pspec, quark_property_parser)); + (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser)); G_VALUE_LCOPY (peek_value, var_args, 0, &error); if (error) { diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 20a29d870e..41c6486ca2 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1135,7 +1135,7 @@ gtk_window_remove_accel_group (GtkWindow *window, g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); g_signal_handlers_disconnect_by_func (accel_group, - G_CALLBACK (gtk_window_notify_keys_changed), + (gpointer) gtk_window_notify_keys_changed, window); _gtk_accel_group_detach (accel_group, G_OBJECT (window)); }