Skip to content

Commit

Permalink
x11-toolkits/gtk-sharp20: fix build with clang 15
Browse files Browse the repository at this point in the history
During an exp-run for llvm 15 (see bug 265425), it turned out that
x11-toolkits/gtk-sharp20 failed to build with clang 15:

  windowmanager.c:113:12: error: incompatible integer to pointer conversion assigning to 'gpointer' (aka 'void *') from 'long' [-Wint-conversion]
                  list [i] = data [i];
                           ^ ~~~~~~~~

This is because gdk_property_get() always returns an array of longs, and
these have to be cast to whatever the desired outcome type is.

PR:		268812
Approved by:	portmgr (tcberner)
MFH:		2023Q1
  • Loading branch information
DimitryAndric committed Jan 16, 2023
1 parent ca9de74 commit a68bb8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions x11-toolkits/gtk-sharp20/files/patch-gdk_glue_windowmanager.c
@@ -0,0 +1,11 @@
--- gdk/glue/windowmanager.c.orig 2016-09-22 10:17:18 UTC
+++ gdk/glue/windowmanager.c
@@ -110,7 +110,7 @@ gtksharp_get_gdk_net_client_list (int *count)
list = g_malloc (*count * sizeof (gpointer));
/* Put all of the windows into a GList to return */
for (i = 0; i < *count; i ++) {
- list [i] = data [i];
+ list [i] = (gpointer) data [i];
g_message ("WinID: %d", list [i]);
}

0 comments on commit a68bb8c

Please sign in to comment.