From ab64b00b48ab78496245d5bb0eda1d51fcb9e209 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Fri, 11 Sep 2015 23:48:05 +0900 Subject: [PATCH] playback: fix build error for 64bit Windows build by MinGW Casting to gpointer from gulong generates the following warning with 64bit Windows target MinGW: gstplaybin2.c: In function 'pad_added_cb': gstplaybin2.c:3476:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (gpointer) group_id_probe_handler); ^ cc1: all warnings being treated as errors We should cast to guintptr from gulong before we cast to gpointer. https://bugzilla.gnome.org/show_bug.cgi?id=754755 --- gst/playback/gstplaybin2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 847cdeb1b7..658fc25495 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -250,6 +250,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug); #define GST_IS_PLAY_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAY_BIN)) #define GST_IS_PLAY_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAY_BIN)) +#define ULONG_TO_POINTER(number) ((gpointer) (guintptr) (number)) + #define VOLUME_MAX_DOUBLE 10.0 typedef struct _GstPlayBin GstPlayBin; @@ -3437,7 +3439,7 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group) G_CALLBACK (notify_tags_cb), ntdata, (GClosureNotify) g_free, (GConnectFlags) 0); g_object_set_data (G_OBJECT (sinkpad), "playbin.notify_tags_handler", - (gpointer) (guintptr) notify_tags_handler); + ULONG_TO_POINTER (notify_tags_handler)); } /* store the pad in the array */ @@ -3472,7 +3474,7 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group) gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, _uridecodebin_event_probe, group, NULL); g_object_set_data (G_OBJECT (pad), "playbin.event_probe_id", - (gpointer) group_id_probe_handler); + ULONG_TO_POINTER (group_id_probe_handler)); if (changed) { int signal;