Index: gst/gstbuffer.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstbuffer.h,v
retrieving revision 1.107
diff -u -p -r1.107 gstbuffer.h
--- gst/gstbuffer.h	15 Mar 2006 16:29:02 -0000	1.107
+++ gst/gstbuffer.h	19 Mar 2006 17:05:45 -0000
@@ -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 GST_BUFFER (gst_mini_object_ref (GST_MINI_OBJECT (buf)));
+}
+
 /**
  * gst_buffer_unref:
  * @buf: a #GstBuffer.
Index: gst/gstevent.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstevent.h,v
retrieving revision 1.92
diff -u -p -r1.92 gstevent.h
--- gst/gstevent.h	7 Mar 2006 16:21:02 -0000	1.92
+++ gst/gstevent.h	19 Mar 2006 17:05:46 -0000
@@ -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 GST_EVENT (gst_mini_object_ref (GST_MINI_OBJECT (ev)));
+}
+
 /**
  * gst_event_unref:
  * @ev: The event to refcount
Index: gst/gstmessage.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstmessage.h,v
retrieving revision 1.35
diff -u -p -r1.35 gstmessage.h
--- gst/gstmessage.h	13 Feb 2006 11:19:32 -0000	1.35
+++ gst/gstmessage.h	19 Mar 2006 17:05:46 -0000
@@ -199,7 +199,14 @@ GQuark		gst_message_type_to_quark	(GstMe
  * 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 GST_MESSAGE (gst_mini_object_ref (GST_MINI_OBJECT (msg)));
+}
+
 /**
  * gst_message_unref:
  * @msg: the message to unref
Index: tests/check/gst/gstevent.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/tests/check/gst/gstevent.c,v
retrieving revision 1.12
diff -u -p -r1.12 gstevent.c
--- tests/check/gst/gstevent.c	22 Nov 2005 11:48:57 -0000	1.12
+++ tests/check/gst/gstevent.c	19 Mar 2006 17:05:49 -0000
@@ -208,7 +208,7 @@ event_probe (GstPad * pad, GstMiniObject
       case GST_EVENT_CUSTOM_BOTH_OOB:
         if (got_event_before_q != NULL)
           break;
-        gst_event_ref (data);
+        gst_event_ref (GST_EVENT(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
       case GST_EVENT_CUSTOM_BOTH_OOB:
         if (got_event_after_q != NULL)
           break;
-        gst_event_ref (data);
+        gst_event_ref (GST_EVENT(data));
         g_get_current_time (&got_event_time);
         got_event_after_q = GST_EVENT (data);
         break;
