examples: Add common_cflags to build

And fix all the warnings and errors generated by doing so.

See #2491
This commit is contained in:
Timm Bäder 2020-03-06 16:36:42 +01:00
parent d7fb33caf7
commit 0e8850bf84
3 changed files with 7 additions and 5 deletions

View File

@ -17,7 +17,7 @@ foreach ex : examples
'-DGDK_DISABLE_DEPRECATED',
'-DGTK_DISABLE_DEPRECATED',
'-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir()),
],
] + common_cflags,
dependencies: libgtk_dep)
endforeach

View File

@ -135,6 +135,7 @@ plug_man_open (GApplication *application,
typedef GtkApplication PlugMan;
typedef GtkApplicationClass PlugManClass;
static GType plug_man_get_type (void);
G_DEFINE_TYPE (PlugMan, plug_man, GTK_TYPE_APPLICATION)
static void
@ -376,10 +377,10 @@ configure_plugins (GSimpleAction *action,
dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
check = (GtkWidget *)gtk_builder_get_object (builder, "red-plugin");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("red"));
g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), "red");
g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "red");
check = (GtkWidget *)gtk_builder_get_object (builder, "black-plugin");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("black"));
g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), "black");
g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "black");
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
@ -481,7 +482,7 @@ plug_man_class_init (PlugManClass *class)
}
PlugMan *
static PlugMan *
plug_man_new (void)
{
return g_object_new (plug_man_get_type (),

View File

@ -70,6 +70,7 @@ open (GApplication *application,
typedef GtkApplication MenuButton;
typedef GtkApplicationClass MenuButtonClass;
static GType menu_button_get_type (void);
G_DEFINE_TYPE (MenuButton, menu_button, GTK_TYPE_APPLICATION)
static void
@ -176,7 +177,7 @@ menu_button_class_init (MenuButtonClass *class)
application_class->open = open;
}
MenuButton *
static MenuButton *
menu_button_new (void)
{
return g_object_new (menu_button_get_type (),