changeset 11134:e4dc16090ddf

8211280: JavaFX build fails on Linux with gcc8 Reviewed-by: kcr, mbilla, arajkumar
author pbansal
date Wed, 19 Dec 2018 12:08:07 +0530
parents 9fb20df0a6fc
children 7e05429623fd
files modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp modules/javafx.graphics/src/main/native-glass/gtk/glass_window_ime.cpp
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp	Tue Dec 18 23:58:08 2018 +0530
+++ b/modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp	Wed Dec 19 12:08:07 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -558,7 +558,7 @@
     return ctx;
 }
 
-static gboolean dnd_finish_callback() {
+static gboolean dnd_finish_callback(gpointer) {
     if (dnd_window) {
         dnd_set_performed_action(
                 translate_gdk_action_to_glass(
@@ -1086,6 +1086,12 @@
     return offset_set;
 }
 
+static void pixbufDestroyNotifyFunc(guchar *pixels, gpointer) {
+    if (pixels != NULL) {
+        g_free(pixels);
+    }
+}
+
 GdkPixbuf* DragView::get_drag_image(gboolean* is_raw_image, gint* width, gint* height) {
     GdkPixbuf *pixbuf = NULL;
     gboolean is_raw = FALSE;
@@ -1113,7 +1119,7 @@
                     if (data) {
                         memcpy(data, (raw + whsz), nraw - whsz);
                         pixbuf = gdk_pixbuf_new_from_data(data, GDK_COLORSPACE_RGB, TRUE, 8,
-                                w, h, w * 4, (GdkPixbufDestroyNotify) g_free, NULL);
+                                w, h, w * 4, pixbufDestroyNotifyFunc, NULL);
                     }
                 }
             }
--- a/modules/javafx.graphics/src/main/native-glass/gtk/glass_window_ime.cpp	Tue Dec 18 23:58:08 2018 +0530
+++ b/modules/javafx.graphics/src/main/native-glass/gtk/glass_window_ime.cpp	Wed Dec 19 12:08:07 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -233,7 +233,7 @@
             return;
         }
 
-        XIMCallback startCallback = {(XPointer) jview, (XIMProc) im_preedit_start};
+        XIMCallback startCallback = {(XPointer) jview, (XIMProc) (void *) im_preedit_start};
         XIMCallback doneCallback = {(XPointer) jview, im_preedit_done};
         XIMCallback drawCallback = {(XPointer) jview, im_preedit_draw};
         XIMCallback caretCallback = {(XPointer) jview, im_preedit_caret};