From 4d2cb748509a1c7061908b10310e13b8b9ed7e7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 26 Nov 2011 18:58:38 +0000 Subject: [PATCH] libs: sprinkle some G_GNUC_MALLOC Maybe gcc can do something clever with that, or at least warn us if we don't save the return value somewhere. --- libs/gst/base/gstadapter.h | 2 +- libs/gst/base/gstbitreader.h | 4 ++-- libs/gst/base/gstbytereader.h | 4 ++-- libs/gst/base/gstbytewriter.h | 12 ++++++------ libs/gst/base/gstdataqueue.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/gst/base/gstadapter.h b/libs/gst/base/gstadapter.h index ae8b781..f4e2a06 100644 --- a/libs/gst/base/gstadapter.h +++ b/libs/gst/base/gstadapter.h @@ -79,7 +79,7 @@ struct _GstAdapterClass { GType gst_adapter_get_type (void); -GstAdapter * gst_adapter_new (void); +GstAdapter * gst_adapter_new (void) G_GNUC_MALLOC; void gst_adapter_clear (GstAdapter *adapter); void gst_adapter_push (GstAdapter *adapter, GstBuffer* buf); diff --git a/libs/gst/base/gstbitreader.h b/libs/gst/base/gstbitreader.h index b5c3935..796dd7e 100644 --- a/libs/gst/base/gstbitreader.h +++ b/libs/gst/base/gstbitreader.h @@ -46,8 +46,8 @@ typedef struct { guint bit; /* Bit position in the current byte */ } GstBitReader; -GstBitReader * gst_bit_reader_new (const guint8 *data, guint size); -GstBitReader * gst_bit_reader_new_from_buffer (const GstBuffer *buffer); +GstBitReader * gst_bit_reader_new (const guint8 *data, guint size) G_GNUC_MALLOC; +GstBitReader * gst_bit_reader_new_from_buffer (const GstBuffer *buffer) G_GNUC_MALLOC; void gst_bit_reader_free (GstBitReader *reader); void gst_bit_reader_init (GstBitReader *reader, const guint8 *data, guint size); diff --git a/libs/gst/base/gstbytereader.h b/libs/gst/base/gstbytereader.h index 8ce76df..0fcb8a7 100644 --- a/libs/gst/base/gstbytereader.h +++ b/libs/gst/base/gstbytereader.h @@ -43,8 +43,8 @@ typedef struct { guint byte; /* Byte position */ } GstByteReader; -GstByteReader * gst_byte_reader_new (const guint8 *data, guint size); -GstByteReader * gst_byte_reader_new_from_buffer (const GstBuffer *buffer); +GstByteReader * gst_byte_reader_new (const guint8 *data, guint size) G_GNUC_MALLOC; +GstByteReader * gst_byte_reader_new_from_buffer (const GstBuffer *buffer) G_GNUC_MALLOC; void gst_byte_reader_free (GstByteReader *reader); void gst_byte_reader_init (GstByteReader *reader, const guint8 *data, guint size); diff --git a/libs/gst/base/gstbytewriter.h b/libs/gst/base/gstbytewriter.h index 8fcd53d..9a765c0 100644 --- a/libs/gst/base/gstbytewriter.h +++ b/libs/gst/base/gstbytewriter.h @@ -48,10 +48,10 @@ typedef struct { gboolean owned; } GstByteWriter; -GstByteWriter * gst_byte_writer_new (void); -GstByteWriter * gst_byte_writer_new_with_size (guint size, gboolean fixed); -GstByteWriter * gst_byte_writer_new_with_data (guint8 *data, guint size, gboolean initialized); -GstByteWriter * gst_byte_writer_new_with_buffer (GstBuffer *buffer, gboolean initialized); +GstByteWriter * gst_byte_writer_new (void) G_GNUC_MALLOC; +GstByteWriter * gst_byte_writer_new_with_size (guint size, gboolean fixed) G_GNUC_MALLOC; +GstByteWriter * gst_byte_writer_new_with_data (guint8 *data, guint size, gboolean initialized) G_GNUC_MALLOC; +GstByteWriter * gst_byte_writer_new_with_buffer (GstBuffer *buffer, gboolean initialized) G_GNUC_MALLOC; void gst_byte_writer_init (GstByteWriter *writer); void gst_byte_writer_init_with_size (GstByteWriter *writer, guint size, gboolean fixed); @@ -60,11 +60,11 @@ void gst_byte_writer_init_with_buffer (GstByteWriter *writer, GstBuffer *buffer, void gst_byte_writer_free (GstByteWriter *writer); guint8 * gst_byte_writer_free_and_get_data (GstByteWriter *writer); -GstBuffer *gst_byte_writer_free_and_get_buffer (GstByteWriter *writer); +GstBuffer *gst_byte_writer_free_and_get_buffer (GstByteWriter *writer) G_GNUC_MALLOC; void gst_byte_writer_reset (GstByteWriter *writer); guint8 * gst_byte_writer_reset_and_get_data (GstByteWriter *writer); -GstBuffer *gst_byte_writer_reset_and_get_buffer (GstByteWriter *writer); +GstBuffer *gst_byte_writer_reset_and_get_buffer (GstByteWriter *writer) G_GNUC_MALLOC; /** * gst_byte_writer_get_pos: diff --git a/libs/gst/base/gstdataqueue.h b/libs/gst/base/gstdataqueue.h index d38230b5..dea1954 100644 --- a/libs/gst/base/gstdataqueue.h +++ b/libs/gst/base/gstdataqueue.h @@ -158,12 +158,12 @@ struct _GstDataQueueClass GType gst_data_queue_get_type (void); GstDataQueue * gst_data_queue_new (GstDataQueueCheckFullFunction checkfull, - gpointer checkdata); + gpointer checkdata) G_GNUC_MALLOC; GstDataQueue * gst_data_queue_new_full (GstDataQueueCheckFullFunction checkfull, GstDataQueueFullCallback fullcallback, GstDataQueueEmptyCallback emptycallback, - gpointer checkdata); + gpointer checkdata) G_GNUC_MALLOC; gboolean gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item); gboolean gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item); -- 2.7.4