From 3f8eff5c7ed35bb0259a7a2da79063f56ee2b862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 30 Jan 2013 13:06:44 +0000 Subject: [PATCH] dataqueue: can't pass a GType through GINT_TO_POINTER Use GSIZE_TO_POINTER instead. sizeof(GType) may be larger than sizeof(gulong) and sizeof(int), so the casts may chop off some bits from the GType value on some architectures. --- libs/gst/base/gstdataqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstdataqueue.c b/libs/gst/base/gstdataqueue.c index 608499ed8c..1ceea0ca35 100644 --- a/libs/gst/base/gstdataqueue.c +++ b/libs/gst/base/gstdataqueue.c @@ -556,7 +556,7 @@ flushing: static gint is_of_type (gconstpointer a, gconstpointer b) { - return !G_TYPE_CHECK_INSTANCE_TYPE (a, GPOINTER_TO_INT (b)); + return !G_TYPE_CHECK_INSTANCE_TYPE (a, GPOINTER_TO_SIZE (b)); } /** @@ -583,7 +583,7 @@ gst_data_queue_drop_head (GstDataQueue * queue, GType type) GST_DEBUG ("queue:%p", queue); GST_DATA_QUEUE_MUTEX_LOCK (queue); - idx = gst_queue_array_find (priv->queue, is_of_type, GINT_TO_POINTER (type)); + idx = gst_queue_array_find (priv->queue, is_of_type, GSIZE_TO_POINTER (type)); if (idx == -1) goto done;