diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h
index 44c3210..730ff81 100644
--- a/gst/gstbuffer.h
+++ b/gst/gstbuffer.h
@@ -380,7 +380,7 @@ G_INLINE_FUNC GstBuffer * gst_buffer_copy (const GstBuffer * buf);
 static inline GstBuffer *
 gst_buffer_copy (const GstBuffer * buf)
 {
-  return GST_BUFFER (gst_mini_object_copy (GST_MINI_OBJECT_CAST (buf)));
+  return GST_BUFFER (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (buf)));
 }
 
 
diff --git a/gst/gstbufferlist.h b/gst/gstbufferlist.h
index c75a07b..635817e 100644
--- a/gst/gstbufferlist.h
+++ b/gst/gstbufferlist.h
@@ -179,7 +179,7 @@ G_INLINE_FUNC GstBufferList * gst_buffer_list_copy (const GstBufferList * list);
 static inline GstBufferList *
 gst_buffer_list_copy (const GstBufferList * list)
 {
-  return GST_BUFFER_LIST_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CAST (list)));
+  return GST_BUFFER_LIST_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (list)));
 }
 
 /**
diff --git a/gst/gstevent.h b/gst/gstevent.h
index 6fc809f..7ee460d 100644
--- a/gst/gstevent.h
+++ b/gst/gstevent.h
@@ -400,7 +400,7 @@ G_INLINE_FUNC GstEvent * gst_event_copy (const GstEvent * event);
 static inline GstEvent *
 gst_event_copy (const GstEvent * event)
 {
-  return GST_EVENT_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CAST (event)));
+  return GST_EVENT_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (event)));
 }
 
 
diff --git a/gst/gstmessage.h b/gst/gstmessage.h
index 83c280f..d845c32 100644
--- a/gst/gstmessage.h
+++ b/gst/gstmessage.h
@@ -341,7 +341,7 @@ G_INLINE_FUNC GstMessage * gst_message_copy (const GstMessage * msg);
 static inline GstMessage *
 gst_message_copy (const GstMessage * msg)
 {
-  return GST_MESSAGE_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CAST (msg)));
+  return GST_MESSAGE_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (msg)));
 }
 
 /**
diff --git a/gst/gstminiobject.h b/gst/gstminiobject.h
index da05a31..9bb56d6 100644
--- a/gst/gstminiobject.h
+++ b/gst/gstminiobject.h
@@ -36,6 +36,7 @@ G_BEGIN_DECLS
 #define GST_MINI_OBJECT(obj)          (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MINI_OBJECT, GstMiniObject))
 #define GST_MINI_OBJECT_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MINI_OBJECT, GstMiniObjectClass))
 #define GST_MINI_OBJECT_CAST(obj)     ((GstMiniObject*)(obj))
+#define GST_MINI_OBJECT_CONST_CAST(obj) ((const GstMiniObject*)(obj))
 
 typedef struct _GstMiniObject GstMiniObject;
 typedef struct _GstMiniObjectClass GstMiniObjectClass;
diff --git a/gst/gstquery.h b/gst/gstquery.h
index ae9b07b..7077dc6 100644
--- a/gst/gstquery.h
+++ b/gst/gstquery.h
@@ -237,7 +237,7 @@ G_INLINE_FUNC GstQuery * gst_query_copy (const GstQuery * q);
 static inline GstQuery *
 gst_query_copy (const GstQuery * q)
 {
-  return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CAST (q)));
+  return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (q)));
 }
 
 /**
diff --git a/gst/gstutils.h b/gst/gstutils.h
index 82860bb..b3e4705 100644
--- a/gst/gstutils.h
+++ b/gst/gstutils.h
@@ -270,7 +270,7 @@ GST_BOILERPLATE_FULL (type, type_as_function, parent_type,              \
 
 /* Define PUT and GET functions for unaligned memory */
 #define _GST_GET(__data, __idx, __size, __shift) \
-    (((guint##__size) (((guint8 *) (__data))[__idx])) << (__shift))
+    (((guint##__size) (((const guint8 *) (__data))[__idx])) << (__shift))
 
 #define _GST_PUT(__data, __idx, __size, __shift, __num) \
     (((guint8 *) (__data))[__idx] = (((guint##__size) (__num)) >> (__shift)) & 0xff)
diff --git a/libs/gst/base/gstbytereader.h b/libs/gst/base/gstbytereader.h
index e3f2db2..ab98262 100644
--- a/libs/gst/base/gstbytereader.h
+++ b/libs/gst/base/gstbytereader.h
@@ -27,6 +27,7 @@
 G_BEGIN_DECLS
 
 #define GST_BYTE_READER(reader) ((GstByteReader *) (reader))
+#define GST_BYTE_READER_CONST(reader) ((const GstByteReader *) (reader))
 
 /**
  * GstByteReader:
diff --git a/libs/gst/base/gstbytewriter.h b/libs/gst/base/gstbytewriter.h
index 743e9db..89d27f2 100644
--- a/libs/gst/base/gstbytewriter.h
+++ b/libs/gst/base/gstbytewriter.h
@@ -94,17 +94,17 @@ GstBuffer *gst_byte_writer_reset_and_get_buffer (GstByteWriter *writer);
  */
 #ifdef _FOOL_GTK_DOC_
 G_INLINE_FUNC guint gst_byte_writer_get_pos (const GstByteWriter *writer);
-G_INLINE_FUNC gboolean gst_byte_writer_set_pos (const GstByteWriter *writer, guint pos);
+G_INLINE_FUNC gboolean gst_byte_writer_set_pos (GstByteWriter *writer, guint pos);
 G_INLINE_FUNC guint gst_byte_writer_get_size (const GstByteWriter *writer);
 #else
 static inline guint
 gst_byte_writer_get_pos (const GstByteWriter *writer)
 {
-  return gst_byte_reader_get_pos (GST_BYTE_READER (writer));
+  return gst_byte_reader_get_pos (GST_BYTE_READER_CONST (writer));
 }
 
 static inline gboolean
-gst_byte_writer_set_pos (const GstByteWriter *writer, guint pos)
+gst_byte_writer_set_pos (GstByteWriter *writer, guint pos)
 {
   return gst_byte_reader_set_pos (GST_BYTE_READER (writer), pos);
 }
@@ -112,7 +112,7 @@ gst_byte_writer_set_pos (const GstByteWriter *writer, guint pos)
 static inline guint
 gst_byte_writer_get_size (const GstByteWriter *writer)
 {
-  return gst_byte_reader_get_size (GST_BYTE_READER (writer));
+  return gst_byte_reader_get_size (GST_BYTE_READER_CONST (writer));
 }
 #endif
 
