On Fri, May 15, 2026 at 11:58:45AM +0200, Matthieu Herrb wrote:
> Always those incompatible types errors. A bunch of new patches for
> llvm 22. Ok ?
OK
>
> Index: Makefile
> ===================================================================
> RCS file: /local/cvs/ports/x11/gtk+2/Makefile,v
> diff -u -p -u -r1.251 Makefile
> --- Makefile 13 Nov 2025 15:57:51 -0000 1.251
> +++ Makefile 15 May 2026 09:58:23 -0000
> @@ -9,8 +9,8 @@ GNOME_PROJECT= gtk+
> PKGNAME-main= gtk+2-${GNOME_VERSION}
> PKGNAME-cups= gtk+2-cups-${GNOME_VERSION}
>
> -REVISION-main= 7
> -REVISION-cups= 5
> +REVISION-main= 8
> +REVISION-cups= 6
>
> CATEGORIES= x11 devel
>
> Index: patches/patch-gtk_gtkcellrendererspin_c
> ===================================================================
> RCS file: patches/patch-gtk_gtkcellrendererspin_c
> diff -N patches/patch-gtk_gtkcellrendererspin_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtkcellrendererspin_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtkcellrendererspin.c
> +--- gtk/gtkcellrendererspin.c.orig
> ++++ gtk/gtkcellrendererspin.c
> +@@ -207,7 +207,7 @@ gtk_cell_renderer_spin_set_property (GObject *obj
> + }
> +
> + if (obj)
> +- priv->adjustment = g_object_ref_sink (obj);
> ++ priv->adjustment = (GtkAdjustment *)g_object_ref_sink (obj);
> + break;
> + case PROP_CLIMB_RATE:
> + priv->climb_rate = g_value_get_double (value);
> Index: patches/patch-gtk_gtkcomboboxtext_c
> ===================================================================
> RCS file: patches/patch-gtk_gtkcomboboxtext_c
> diff -N patches/patch-gtk_gtkcomboboxtext_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtkcomboboxtext_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtkcomboboxtext.c
> +--- gtk/gtkcomboboxtext.c.orig
> ++++ gtk/gtkcomboboxtext.c
> +@@ -275,7 +275,7 @@ gtk_combo_box_text_buildable_custom_tag_start (GtkBuil
> +
> + parser_data = g_slice_new0 (ItemParserData);
> + parser_data->builder = g_object_ref (builder);
> +- parser_data->object = g_object_ref (buildable);
> ++ parser_data->object = (GObject *)g_object_ref (buildable);
> + parser_data->domain = gtk_builder_get_translation_domain (builder);
> + *parser = item_parser;
> + *data = parser_data;
> Index: patches/patch-gtk_gtkimmodule_c
> ===================================================================
> RCS file: patches/patch-gtk_gtkimmodule_c
> diff -N patches/patch-gtk_gtkimmodule_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtkimmodule_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,19 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtkimmodule.c
> +--- gtk/gtkimmodule.c.orig
> ++++ gtk/gtkimmodule.c
> +@@ -660,11 +660,11 @@ lookup_immodule (gchar **immodules_list)
> + else
> + {
> + gboolean found;
> +- gchar *context_id;
> ++ gpointer context_id;
> + found = g_hash_table_lookup_extended (contexts_hash, *immodules_list,
> + &context_id, NULL);
> + if (found)
> +- return context_id;
> ++ return (gchar *)context_id;
> + }
> + immodules_list++;
> + }
> Index: patches/patch-gtk_gtklabel_c
> ===================================================================
> RCS file: patches/patch-gtk_gtklabel_c
> diff -N patches/patch-gtk_gtklabel_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtklabel_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtklabel.c
> +--- gtk/gtklabel.c.orig
> ++++ gtk/gtklabel.c
> +@@ -1336,7 +1336,7 @@ gtk_label_buildable_custom_tag_start (GtkBuildable
> +
> + parser_data = g_slice_new0 (PangoParserData);
> + parser_data->builder = g_object_ref (builder);
> +- parser_data->object = g_object_ref (buildable);
> ++ parser_data->object = (GObject *)g_object_ref (buildable);
> + *parser = pango_parser;
> + *data = parser_data;
> + return TRUE;
> Index: patches/patch-gtk_gtktoolpalette_c
> ===================================================================
> RCS file: patches/patch-gtk_gtktoolpalette_c
> diff -N patches/patch-gtk_gtktoolpalette_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtktoolpalette_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtktoolpalette.c
> +--- gtk/gtktoolpalette.c.orig
> ++++ gtk/gtktoolpalette.c
> +@@ -734,7 +734,7 @@ gtk_tool_palette_add (GtkContainer *container,
> +
> + g_ptr_array_add (palette->priv->groups, info);
> + info->pos = palette->priv->groups->len - 1;
> +- info->widget = g_object_ref_sink (child);
> ++ info->widget = (GtkToolItemGroup *)g_object_ref_sink (child);
> +
> + gtk_widget_set_parent (child, GTK_WIDGET (palette));
> + }
> Index: patches/patch-gtk_gtktreeview_c
> ===================================================================
> RCS file: patches/patch-gtk_gtktreeview_c
> diff -N patches/patch-gtk_gtktreeview_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtktreeview_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtktreeview.c
> +--- gtk/gtktreeview.c.orig
> ++++ gtk/gtktreeview.c
> +@@ -14147,7 +14147,7 @@ gtk_tree_view_set_search_entry (GtkTreeView
> *tree_view
> +
> + if (entry)
> + {
> +- tree_view->priv->search_entry = g_object_ref (entry);
> ++ tree_view->priv->search_entry = (GtkWidget *)g_object_ref (entry);
> + tree_view->priv->search_custom_entry_set = TRUE;
> +
> + if (tree_view->priv->search_entry_changed_id == 0)
> Index: patches/patch-gtk_gtkuimanager_c
> ===================================================================
> RCS file: patches/patch-gtk_gtkuimanager_c
> diff -N patches/patch-gtk_gtkuimanager_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtkuimanager_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtkuimanager.c
> +--- gtk/gtkuimanager.c.orig
> ++++ gtk/gtkuimanager.c
> +@@ -503,7 +503,7 @@ gtk_ui_manager_buildable_construct_child (GtkBuildable
> + g_signal_connect (widget, "hierarchy-changed",
> + G_CALLBACK (child_hierarchy_changed_cb),
> + GTK_UI_MANAGER (buildable));
> +- return g_object_ref (widget);
> ++ return (GObject *)g_object_ref (widget);
> + }
> +
> + static void
> Index: patches/patch-gtk_gtkwidget_c
> ===================================================================
> RCS file: patches/patch-gtk_gtkwidget_c
> diff -N patches/patch-gtk_gtkwidget_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_gtkwidget_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: gtk/gtkwidget.c
> +--- gtk/gtkwidget.c.orig
> ++++ gtk/gtkwidget.c
> +@@ -10679,7 +10679,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable
>
> + AccelGroupParserData *parser_data;
> +
> + parser_data = g_slice_new0 (AccelGroupParserData);
> +- parser_data->object = g_object_ref (buildable);
> ++ parser_data->object = (GObject *)g_object_ref (buildable);
> + *parser = accel_group_parser;
> + *data = parser_data;
> + return TRUE;
> Index: patches/patch-gtk_tests_defaultvalue_c
> ===================================================================
> RCS file: patches/patch-gtk_tests_defaultvalue_c
> diff -N patches/patch-gtk_tests_defaultvalue_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-gtk_tests_defaultvalue_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,32 @@
> +Fix build with llvm 22
> +
> +Index: gtk/tests/defaultvalue.c
> +--- gtk/tests/defaultvalue.c.orig
> ++++ gtk/tests/defaultvalue.c
> +@@ -91,13 +91,13 @@ test_type (gconstpointer data)
> + klass = g_type_class_ref (type);
> +
> + if (g_type_is_a (type, GTK_TYPE_SETTINGS))
> +- instance = g_object_ref (gtk_settings_get_default ());
> ++ instance = (GObject *)g_object_ref (gtk_settings_get_default ());
> + else if (g_type_is_a (type, GDK_TYPE_PANGO_RENDERER))
> +- instance = g_object_ref (gdk_pango_renderer_get_default
> (gdk_screen_get_default ()));
> ++ instance = (GObject *)g_object_ref (gdk_pango_renderer_get_default
> (gdk_screen_get_default ()));
> + else if (g_type_is_a (type, GDK_TYPE_PIXMAP))
> +- instance = g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
> ++ instance = (GObject *)g_object_ref (gdk_pixmap_new (NULL, 1, 1, 1));
> + else if (g_type_is_a (type, GDK_TYPE_COLORMAP))
> +- instance = g_object_ref (gdk_colormap_new (gdk_visual_get_best (),
> TRUE));
> ++ instance = (GObject *)g_object_ref (gdk_colormap_new
> (gdk_visual_get_best (), TRUE));
> + else if (g_type_is_a (type, GDK_TYPE_WINDOW))
> + {
> + GdkWindowAttr attributes;
> +@@ -105,7 +105,7 @@ test_type (gconstpointer data)
> + attributes.event_mask = 0;
> + attributes.width = 100;
> + attributes.height = 100;
> +- instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
> ++ instance = (GObject *)g_object_ref (gdk_window_new (NULL,
> &attributes, 0));
> + }
> + else
> + instance = g_object_new (type, NULL);
> Index: patches/patch-modules_other_gail_gailtreeview_c
> ===================================================================
> RCS file: patches/patch-modules_other_gail_gailtreeview_c
> diff -N patches/patch-modules_other_gail_gailtreeview_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-modules_other_gail_gailtreeview_c 15 May 2026 09:58:23
> -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: modules/other/gail/gailtreeview.c
> +--- modules/other/gail/gailtreeview.c.orig
> ++++ modules/other/gail/gailtreeview.c
> +@@ -995,7 +995,7 @@ gail_tree_view_ref_child (AtkObject *obj,
> + gail_cell_add_state (cell, ATK_STATE_FOCUSABLE, FALSE);
> + if (focus_index == i)
> + {
> +- gailview->focus_cell = g_object_ref (cell);
> ++ gailview->focus_cell = (AtkObject *)g_object_ref (cell);
> + gail_cell_add_state (cell, ATK_STATE_FOCUSED, FALSE);
> + g_signal_emit_by_name (gailview,
> + "active-descendant-changed",
> Index: patches/patch-modules_printbackends_cups_gtkprintbackendcups_c
> ===================================================================
> RCS file: patches/patch-modules_printbackends_cups_gtkprintbackendcups_c
> diff -N patches/patch-modules_printbackends_cups_gtkprintbackendcups_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-modules_printbackends_cups_gtkprintbackendcups_c 15 May
> 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: modules/printbackends/cups/gtkprintbackendcups.c
> +--- modules/printbackends/cups/gtkprintbackendcups.c.orig
> ++++ modules/printbackends/cups/gtkprintbackendcups.c
> +@@ -3479,7 +3479,7 @@ cups_request_ppd (GtkPrinter *printer)
> + g_io_channel_set_encoding (data->ppd_io, NULL, NULL);
> + g_io_channel_set_close_on_unref (data->ppd_io, TRUE);
> +
> +- data->printer = g_object_ref (printer);
> ++ data->printer = (GtkPrinterCups *)g_object_ref (printer);
> +
> + resource = g_strdup_printf ("/printers/%s.ppd",
> + gtk_printer_cups_get_ppd_name
> (GTK_PRINTER_CUPS (printer)));
> Index: patches/patch-tests_testentrycompletion_c
> ===================================================================
> RCS file: patches/patch-tests_testentrycompletion_c
> diff -N patches/patch-tests_testentrycompletion_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-tests_testentrycompletion_c 15 May 2026 09:58:23 -0000
> @@ -0,0 +1,14 @@
> +Fix build with llvm 22
> +
> +Index: tests/testentrycompletion.c
> +--- tests/testentrycompletion.c.orig
> ++++ tests/testentrycompletion.c
> +@@ -237,7 +237,7 @@ animation_timer (GtkEntryCompletion *completion)
> + {
> + g_print ("removing model!\n");
> +
> +- old_store = g_object_ref (gtk_entry_completion_get_model
> (completion));
> ++ old_store = (GtkListStore *)g_object_ref
> (gtk_entry_completion_get_model (completion));
> + gtk_entry_completion_set_model (completion, NULL);
> + }
> + else
>
> --
> Matthieu Herrb
>
--
Antoine