Fix various new mingw compiler warnings
authorChristoph Reiter <reiter.christoph@gmail.com>
Tue, 17 Dec 2019 19:46:36 +0000 (20:46 +0100)
committerChristoph Reiter <reiter.christoph@gmail.com>
Wed, 18 Dec 2019 08:25:06 +0000 (09:25 +0100)
These are the result of us missing CI for some time now and
MSYS2 having a newer GCC now I guess.

gtk/gtkimcontextime.c
tests/simple.c

index 8b08d7179d927823ddb932573cf08f5ca941976c..ec009d40bb2462be2c2804488f7b6b802122a09e 100644 (file)
@@ -682,7 +682,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context)
   toplevel = context_ime->client_surface;
   if (GDK_IS_SURFACE (toplevel))
     {
-      gdk_win32_display_add_filter (gdk_surface_get_display (toplevel),
+      gdk_win32_display_add_filter (GDK_WIN32_DISPLAY (gdk_surface_get_display (toplevel)),
                                     gtk_im_context_ime_message_filter, context_ime);
     }
   else
@@ -780,7 +780,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context)
   toplevel = context_ime->client_surface;
   if (GDK_IS_SURFACE (toplevel))
     {
-      gdk_win32_display_remove_filter (gdk_surface_get_display (toplevel),
+      gdk_win32_display_remove_filter (GDK_WIN32_DISPLAY (gdk_surface_get_display (toplevel)),
                                        gtk_im_context_ime_message_filter,
                                        context_ime);
     }
index 7cd8d52d6892a41f06a92e1c1afc71192ce80d54..c6a7bf9b7ff407c05238f50d179910a7df1c4784 100644 (file)
@@ -82,9 +82,8 @@ hello (void)
 int
 main (int argc, char *argv[])
 {
-  GtkWidget *window, *box;
+  GtkWidget *window;
   GtkWidget *button = NULL;
-  GdkClipboard *clipboard;
 
   gtk_init ();
 
@@ -103,21 +102,25 @@ main (int argc, char *argv[])
   button = gtk_button_new ();
 
 #ifdef G_OS_UNIX /* portal usage is supported on *nix only */
-  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-  gtk_button_set_label (GTK_BUTTON (button), "copy");
-  g_signal_connect (button, "clicked", G_CALLBACK (copy), NULL);
-  gtk_container_add (GTK_CONTAINER (box), button);
+  {
+    GtkWidget *box;
+    GdkClipboard *clipboard;
 
-  button = gtk_button_new ();
-  gtk_button_set_label (GTK_BUTTON (button), "paste");
-  g_signal_connect (button, "clicked", G_CALLBACK (paste), NULL);
-  gtk_container_add (GTK_CONTAINER (box), button);
+    box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+    gtk_button_set_label (GTK_BUTTON (button), "copy");
+    g_signal_connect (button, "clicked", G_CALLBACK (copy), NULL);
+    gtk_container_add (GTK_CONTAINER (box), button);
 
-  gtk_container_add (GTK_CONTAINER (window), box);
+    button = gtk_button_new ();
+    gtk_button_set_label (GTK_BUTTON (button), "paste");
+    g_signal_connect (button, "clicked", G_CALLBACK (paste), NULL);
+    gtk_container_add (GTK_CONTAINER (box), button);
 
-  clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
-  g_signal_connect (clipboard, "changed", G_CALLBACK (clipboard_changed), NULL);
+    gtk_container_add (GTK_CONTAINER (window), box);
 
+    clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
+    g_signal_connect (clipboard, "changed", G_CALLBACK (clipboard_changed), NULL);
+  }
 #else /* G_OS_UNIX -- original non-portal-enabled code */
 
   gtk_button_set_label (GTK_BUTTON (button), "hello world");