buffer: Use an inline function instead of a macro for gst_buffer_replace()

This gives us type checks by the compiler and more useful compiler errors.
This commit is contained in:
Sebastian Dröge 2011-10-13 10:19:34 +02:00
parent ef32fd0d15
commit e8d3870214

View file

@ -460,12 +460,15 @@ GstBuffer* gst_buffer_make_metadata_writable (GstBuffer *buf);
* *
* Either @nbuf or the #GstBuffer pointed to by @obuf may be NULL. * Either @nbuf or the #GstBuffer pointed to by @obuf may be NULL.
*/ */
#define gst_buffer_replace(obuf,nbuf) \ #ifdef _FOOL_GTK_DOC_
G_STMT_START { \ G_INLINE_FUNC void gst_buffer_replace (GstBuffer **obuf, GstBuffer *nbuf);
GstBuffer **___obufaddr = (GstBuffer **)(obuf); \ #endif
gst_mini_object_replace ((GstMiniObject **)___obufaddr, \
GST_MINI_OBJECT_CAST (nbuf)); \ static inline void
} G_STMT_END gst_buffer_replace (GstBuffer **obuf, GstBuffer *nbuf)
{
gst_mini_object_replace ((GstMiniObject **) obuf, (GstMiniObject *) nbuf);
}
GstCaps* gst_buffer_get_caps (GstBuffer *buffer); GstCaps* gst_buffer_get_caps (GstBuffer *buffer);
void gst_buffer_set_caps (GstBuffer *buffer, GstCaps *caps); void gst_buffer_set_caps (GstBuffer *buffer, GstCaps *caps);