From 7f987200b54fcc9f99e30d36248743b44807de6f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 6 Nov 2008 15:37:16 +0000 Subject: [PATCH] gst/gstvalue.c: Reorganize some more, be more conservative with the GST_TYPE_ARRAY not being fixed and inline the tri... Original commit message from CVS: * gst/gstvalue.c: (gst_type_is_fixed), (gst_value_is_fixed): Reorganize some more, be more conservative with the GST_TYPE_ARRAY not being fixed and inline the trivial check. --- ChangeLog | 6 ++++++ gst/gstvalue.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 926aecd..7b3ac48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-11-06 Wim Taymans + * gst/gstvalue.c: (gst_type_is_fixed), (gst_value_is_fixed): + Reorganize some more, be more conservative with the GST_TYPE_ARRAY not + being fixed and inline the trivial check. + +2008-11-06 Wim Taymans + * gst/gstcaps.c: (gst_caps_copy), (_gst_caps_free), (gst_caps_merge_structure), (gst_caps_get_structure), (gst_caps_copy_nth), (gst_caps_set_simple), diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 3a7b44c..66b2746 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -157,8 +157,7 @@ gst_type_is_fixed (GType type) } /* our fundamental types that are certainly not fixed */ if (type == GST_TYPE_INT_RANGE || type == GST_TYPE_DOUBLE_RANGE || - type == GST_TYPE_LIST || type == GST_TYPE_FRACTION_RANGE || - type == GST_TYPE_ARRAY) { + type == GST_TYPE_LIST || type == GST_TYPE_FRACTION_RANGE) { return FALSE; } /* other (boxed) types that are fixed */ @@ -3342,8 +3341,10 @@ gst_value_is_fixed (const GValue * value) { GType type = G_VALUE_TYPE (value); - if (gst_type_is_fixed (type)) + /* the most common types are just basic plain glib types */ + if (type <= G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_GLIB_LAST)) { return TRUE; + } if (type == GST_TYPE_ARRAY) { gint size, n; @@ -3358,8 +3359,7 @@ gst_value_is_fixed (const GValue * value) } return TRUE; } - - return FALSE; + return gst_type_is_fixed (type); } /************ -- 2.7.4