summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f9204d5)
raw | patch | inline | side by side (parent: f9204d5)
author | Jeffrey S. Smith <whydoubt@yahoo.com> | |
Wed, 1 Sep 2010 23:01:25 +0000 (00:01 +0100) | ||
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | |
Wed, 1 Sep 2010 23:09:08 +0000 (00:09 +0100) |
Make code including GStreamer headers compile with -Wcast-qual by
maintaining const-ness when casting. Also fix function signature of
gst_byte_writer_set_pos(): the byte writer should not be marked as
const.
https://bugzilla.gnome.org/show_bug.cgi?id=627910
maintaining const-ness when casting. Also fix function signature of
gst_byte_writer_set_pos(): the byte writer should not be marked as
const.
https://bugzilla.gnome.org/show_bug.cgi?id=627910
index 448898377c3603854feae1538856e56ee25fcdf0..361ed23a0ae41470d969d5ec0959934ded5c4a4e 100644 (file)
GST_TYPE_MINI_OBJECT
GST_TYPE_MINI_OBJECT_FLAGS
GST_MINI_OBJECT_CAST
+GST_MINI_OBJECT_CONST_CAST
GST_IS_PARAM_SPEC_MINI_OBJECT
GST_PARAM_SPEC_MINI_OBJECT
diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h
index 44c32109e98a446c888da6a5c3dbad4b6565f2bb..730ff81bd697e040f8836d1aa5a77b4270316a90 100644 (file)
--- a/gst/gstbuffer.h
+++ b/gst/gstbuffer.h
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 c75a07b3ea44fd87d06a20259a3e1250ee1f3581..635817e0172318efee6aa49c635aae1c0acafb6a 100644 (file)
--- 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 6fc809fa48f74aa4f81f612a7c78d5b309d90c1b..7ee460d533ed1ccbcb46b1df69f8be4d90237818 100644 (file)
--- a/gst/gstevent.h
+++ b/gst/gstevent.h
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 83c280f005879f6918c885cb68c2dafe3837f2d2..d845c3297242ced50c3f63cd0d87bb477e5d661f 100644 (file)
--- a/gst/gstmessage.h
+++ b/gst/gstmessage.h
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 da05a3141100119acd6adb668b32f7178beab580..9bb56d6dec0fb73b0512cd826ed6bc1a10b86ce9 100644 (file)
--- a/gst/gstminiobject.h
+++ b/gst/gstminiobject.h
#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 ae9b07bc86d66cbe2bb4883d417595ecef03940a..7077dc650dda9a425bcc80910a82d1f3bff908de 100644 (file)
--- a/gst/gstquery.h
+++ b/gst/gstquery.h
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 f91b77749ac845725f397ffe4e97c6ccd2f03f86..fad4ff56b54627f0b48d90918d58e7ffaf17376e 100644 (file)
--- a/gst/gstutils.h
+++ b/gst/gstutils.h
/* 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)
index 743e9dbcd28e3eb27463aca776caf684da900e6b..fe1881fb791711f4ac5303a2f58915b2fc01923d 100644 (file)
*/
#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 ((const GstByteReader *) 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);
}
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 ((const GstByteReader *) writer);
}
#endif