make some macros into inline functions

This commit is contained in:
Wim Taymans 2011-12-05 11:07:24 +01:00
parent be0e58a637
commit c2efd026db
2 changed files with 21 additions and 4 deletions

View file

@ -390,9 +390,18 @@ gst_message_copy (const GstMessage * msg)
* message is unreffed, the new one is reffed).
*
* Either @new_message or the #GstMessage pointed to by @old_message may be NULL.
*
* Returns: TRUE if @new_message was different from @old_message
*/
#define gst_message_replace(old_message,new_message) \
gst_mini_object_replace ((GstMiniObject **)(old_message), GST_MINI_OBJECT_CAST (new_message))
#ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gboolean gst_message_replace (GstMessage **old_message, GstMessage *new_message);
#endif
static inline gboolean
gst_message_replace (GstMessage **old_message, GstMessage *new_message)
{
return gst_mini_object_replace ((GstMiniObject **) old_message, (GstMiniObject *) new_message);
}
/* custom messages */

View file

@ -248,10 +248,18 @@ gst_query_copy (const GstQuery * q)
* query is unreffed, the new one is reffed).
*
* Either @new_query or the #GstQuery pointed to by @old_query may be NULL.
*
* Returns: TRUE if @new_query was different from @old_query
*/
#define gst_query_replace(old_query,new_query) \
gst_mini_object_replace ((GstMiniObject **)(old_query), GST_MINI_OBJECT_CAST (new_query))
#ifdef _FOOL_GTK_DOC_
G_INLINE_FUNC gboolean gst_query_replace (GstQuery **old_query, GstQuery *new_query);
#endif
static inline gboolean
gst_query_replace (GstQuery **old_query, GstQuery *new_query)
{
return gst_mini_object_replace ((GstMiniObject **) old_query, (GstMiniObject *) new_query);
}
/* application specific query */
GstQuery * gst_query_new_custom (GstQueryType type, GstStructure *structure) G_GNUC_MALLOC;