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.
This commit is contained in:
Tim-Philipp Müller 2011-11-26 18:58:38 +00:00
parent c8380cb0d2
commit 4d2cb74850
5 changed files with 13 additions and 13 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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:

View file

@ -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);