gst/: gst_[buffer|event|message]_ref() macros are replaced by a static inline functions because gcc-4.1 will about if...

Original commit message from CVS:
* gst/gstbuffer.h:
* gst/gstevent.h:
* gst/gstmessage.h:
gst_[buffer|event|message]_ref() macros are replaced by a static
inline functions because gcc-4.1 will about if the return value
isn't used.
* tests/check/gst/gstevent.c: (event_probe):
gst_event_ref now has to be given a GstEvent* , fix check accordingly.
This commit is contained in:
Edward Hervey 2006-03-21 13:50:52 +00:00
parent 9384cd9051
commit 067db77499
5 changed files with 37 additions and 5 deletions

View file

@ -1,3 +1,14 @@
2006-03-21 Edward Hervey <edward@fluendo.com>
* gst/gstbuffer.h:
* gst/gstevent.h:
* gst/gstmessage.h:
gst_[buffer|event|message]_ref() macros are replaced by a static
inline functions because gcc-4.1 will about if the return value
isn't used.
* tests/check/gst/gstevent.c: (event_probe):
gst_event_ref now has to be given a GstEvent* , fix check accordingly.
2006-03-20 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gstutils.h:

View file

@ -287,7 +287,14 @@ G_STMT_START { \
*
* Increases the refcount of the given buffer by one.
*/
#define gst_buffer_ref(buf) GST_BUFFER_CAST (gst_mini_object_ref (GST_MINI_OBJECT (buf)))
static inline GstBuffer *
gst_buffer_ref (GstBuffer * buf)
{
/* not using a macro here because gcc-4.1 will complain
* if the return value isn't used (because of the cast) */
return (GstBuffer *) gst_mini_object_ref (GST_MINI_OBJECT (buf));
}
/**
* gst_buffer_unref:
* @buf: a #GstBuffer.

View file

@ -325,7 +325,14 @@ GType gst_event_get_type (void);
*
* Increase the refcount of this event.
*/
#define gst_event_ref(ev) GST_EVENT (gst_mini_object_ref (GST_MINI_OBJECT (ev)))
static inline GstEvent *
gst_event_ref (GstEvent * ev)
{
/* not using a macro here because gcc-4.1 will complain
* if the return value isn't used (because of the cast) */
return (GstEvent *) gst_mini_object_ref (GST_MINI_OBJECT (ev));
}
/**
* gst_event_unref:
* @ev: The event to refcount

View file

@ -199,7 +199,14 @@ GQuark gst_message_type_to_quark (GstMessageType type);
* Convenience macro to increase the reference count of the message. Returns the
* reffed message.
*/
#define gst_message_ref(msg) GST_MESSAGE (gst_mini_object_ref (GST_MINI_OBJECT (msg)))
static inline GstMessage *
gst_message_ref (GstMessage * msg)
{
/* not using a macro here because gcc-4.1 will complain
* if the return value isn't used (because of the cast) */
return (GstMessage *) gst_mini_object_ref (GST_MINI_OBJECT (msg));
}
/**
* gst_message_unref:
* @msg: the message to unref

View file

@ -208,7 +208,7 @@ event_probe (GstPad * pad, GstMiniObject ** data, gpointer user_data)
case GST_EVENT_CUSTOM_BOTH_OOB:
if (got_event_before_q != NULL)
break;
gst_event_ref (data);
gst_event_ref ((GstEvent *) data);
g_get_current_time (&got_event_time);
got_event_before_q = GST_EVENT (data);
break;
@ -223,7 +223,7 @@ event_probe (GstPad * pad, GstMiniObject ** data, gpointer user_data)
case GST_EVENT_CUSTOM_BOTH_OOB:
if (got_event_after_q != NULL)
break;
gst_event_ref (data);
gst_event_ref ((GstEvent *) data);
g_get_current_time (&got_event_time);
got_event_after_q = GST_EVENT (data);
break;