From 16e568448687a4b3f42e98384e18bbe28bcd4b59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 14 Jun 2012 23:54:22 +0100 Subject: [PATCH] query: no need to store the size of the structure inside the structure --- gst/gstquery.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gst/gstquery.c b/gst/gstquery.c index 694113c..9304742 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -77,12 +77,10 @@ static GType _gst_query_type = 0; typedef struct { GstQuery query; - gsize slice_size; GstStructure *structure; } GstQueryImpl; -#define GST_QUERY_SLICE_SIZE(q) (((GstQueryImpl *)(q))->slice_size) #define GST_QUERY_STRUCTURE(q) (((GstQueryImpl *)(q))->structure) @@ -204,7 +202,7 @@ _gst_query_free (GstQuery * query) gst_structure_free (s); } - g_slice_free1 (GST_QUERY_SLICE_SIZE (query), query); + g_slice_free1 (sizeof (GstQueryImpl), query); } static GstQuery * @@ -223,14 +221,13 @@ _gst_query_copy (GstQuery * query) } static void -gst_query_init (GstQueryImpl * query, gsize size, GstQueryType type) +gst_query_init (GstQueryImpl * query, GstQueryType type) { gst_mini_object_init (GST_MINI_OBJECT_CAST (query), _gst_query_type); query->query.mini_object.copy = (GstMiniObjectCopyFunction) _gst_query_copy; query->query.mini_object.free = (GstMiniObjectFreeFunction) _gst_query_free; - GST_QUERY_SLICE_SIZE (query) = size; GST_QUERY_TYPE (query) = type; } @@ -705,7 +702,7 @@ gst_query_new_custom (GstQueryType type, GstStructure * structure) &query->query.mini_object.refcount)) goto had_parent; } - gst_query_init (query, sizeof (GstQueryImpl), type); + gst_query_init (query, type); GST_QUERY_STRUCTURE (query) = structure; @@ -714,7 +711,7 @@ gst_query_new_custom (GstQueryType type, GstStructure * structure) /* ERRORS */ had_parent: { - g_slice_free1 (GST_QUERY_SLICE_SIZE (query), query); + g_slice_free1 (sizeof (GstQueryImpl), query); g_warning ("structure is already owned by another object"); return NULL; } -- 2.7.4