From 5d80cf12ba095ab1957a8732d37e34a8b37551b9 Mon Sep 17 00:00:00 2001 From: Evan Nemerson Date: Wed, 11 Jun 2014 16:06:19 -0700 Subject: introspection: add nullability annotations to out and inout params https://bugzilla.gnome.org/show_bug.cgi?id=730957 --- gst/gstbuffer.c | 8 ++++---- gst/gstbuffer.h | 6 +++--- gst/gstbufferlist.h | 2 +- gst/gstcaps.h | 4 ++-- gst/gstevent.h | 12 ++++++------ gst/gstmessage.h | 4 ++-- gst/gstobject.c | 4 ++-- gst/gstpreset.c | 6 +++--- gst/gstquery.h | 4 ++-- gst/gsttoc.c | 14 ++++++++------ gst/gstvalue.c | 13 ++++++++----- 11 files changed, 41 insertions(+), 36 deletions(-) diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 39cfe08ed..24efc56bc 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -1235,8 +1235,8 @@ gst_buffer_is_all_memory_writable (GstBuffer * buffer) /** * gst_buffer_get_sizes: * @buffer: a #GstBuffer. - * @offset: (out): a pointer to the offset - * @maxsize: (out): a pointer to the maxsize + * @offset: (out) (allow-none): a pointer to the offset + * @maxsize: (out) (allow-none): a pointer to the maxsize * * Get the total size of the memory blocks in @b. * @@ -1273,8 +1273,8 @@ gst_buffer_get_size (GstBuffer * buffer) * @buffer: a #GstBuffer. * @idx: an index * @length: a length - * @offset: (out): a pointer to the offset - * @maxsize: (out): a pointer to the maxsize + * @offset: (out) (allow-none): a pointer to the offset + * @maxsize: (out) (allow-none): a pointer to the maxsize * * Get the total size of @length memory blocks stating from @idx in @buffer. * diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index 0ebf1428b..643db7d6a 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -457,8 +457,8 @@ gboolean gst_buffer_copy_into (GstBuffer *dest, GstBuffer *src /** * gst_buffer_replace: - * @obuf: (inout) (transfer full): pointer to a pointer to a #GstBuffer to be - * replaced. + * @obuf: (inout) (transfer full) (nullable): pointer to a pointer to + * a #GstBuffer to be replaced. * @nbuf: (transfer none) (allow-none): pointer to a #GstBuffer that will * replace the buffer pointed to by @obuf. * @@ -496,7 +496,7 @@ GstBuffer* gst_buffer_append (GstBuffer *buf1, GstBuffer *buf /** * GstBufferForeachMetaFunc: * @buffer: a #GstBuffer - * @meta: a pointer to a #GstMeta + * @meta: (out) (nullable): a pointer to a #GstMeta * @user_data: user data passed to gst_buffer_foreach_meta() * * A function that will be called from gst_buffer_foreach_meta(). The @meta diff --git a/gst/gstbufferlist.h b/gst/gstbufferlist.h index df8c455e7..e5ddb0892 100644 --- a/gst/gstbufferlist.h +++ b/gst/gstbufferlist.h @@ -38,7 +38,7 @@ typedef struct _GstBufferList GstBufferList; /** * GstBufferListFunc: - * @buffer: pointer the buffer + * @buffer: (out) (nullable): pointer the buffer * @idx: the index of @buffer * @user_data: user data passed to gst_buffer_list_foreach() * diff --git a/gst/gstcaps.h b/gst/gstcaps.h index e29da343a..2acf84cb4 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -288,8 +288,8 @@ gst_caps_copy (const GstCaps * caps) /** * gst_caps_replace: - * @old_caps: (inout) (transfer full): pointer to a pointer to a #GstCaps to be - * replaced. + * @old_caps: (inout) (transfer full) (nullable): pointer to a pointer + * to a #GstCaps to be replaced. * @new_caps: (transfer none) (allow-none): pointer to a #GstCaps that will * replace the caps pointed to by @ocaps. * diff --git a/gst/gstevent.h b/gst/gstevent.h index 2ee38eb73..db3cb518d 100644 --- a/gst/gstevent.h +++ b/gst/gstevent.h @@ -275,8 +275,8 @@ GST_EXPORT GType _gst_event_type; #define gst_event_make_writable(ev) GST_EVENT_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (ev))) /** * gst_event_replace: - * @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent - * to be replaced. + * @old_event: (inout) (transfer full) (nullable): pointer to a + * pointer to a #GstEvent to be replaced. * @new_event: (allow-none) (transfer none): pointer to a #GstEvent that will * replace the event pointed to by @old_event. * @@ -301,8 +301,8 @@ gst_event_replace (GstEvent **old_event, GstEvent *new_event) /** * gst_event_steal: - * @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent - * to be stolen. + * @old_event: (inout) (transfer full) (nullable): pointer to a + * pointer to a #GstEvent to be stolen. * * Atomically replace the #GstEvent pointed to by @old_event with %NULL and * return the original event. @@ -321,8 +321,8 @@ gst_event_steal (GstEvent **old_event) /** * gst_event_take: - * @old_event: (inout) (transfer full): pointer to a pointer to a #GstEvent - * to be stolen. + * @old_event: (inout) (transfer full) (nullable): pointer to a + * pointer to a #GstEvent to be stolen. * @new_event: (allow-none) (transfer full): pointer to a #GstEvent that will * replace the event pointed to by @old_event. * diff --git a/gst/gstmessage.h b/gst/gstmessage.h index 7433edc6a..8c8e9a8e3 100644 --- a/gst/gstmessage.h +++ b/gst/gstmessage.h @@ -404,8 +404,8 @@ gst_message_copy (const GstMessage * msg) #define gst_message_make_writable(msg) GST_MESSAGE_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (msg))) /** * gst_message_replace: - * @old_message: (inout) (transfer full): pointer to a pointer to a #GstMessage - * to be replaced. + * @old_message: (inout) (transfer full) (nullable): pointer to a + * pointer to a #GstMessage to be replaced. * @new_message: (allow-none) (transfer none): pointer to a #GstMessage that will * replace the message pointed to by @old_message. * diff --git a/gst/gstobject.c b/gst/gstobject.c index 6faf20e82..025000380 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -310,8 +310,8 @@ gst_object_ref_sink (gpointer object) /** * gst_object_replace: - * @oldobj: (inout) (transfer full): pointer to a place of a #GstObject to - * replace + * @oldobj: (inout) (transfer full) (nullable): pointer to a place of + * a #GstObject to replace * @newobj: (transfer none): a new #GstObject * * Atomically modifies a pointer to point to a new object. diff --git a/gst/gstpreset.c b/gst/gstpreset.c index 64db263df..8a9738f9c 100644 --- a/gst/gstpreset.c +++ b/gst/gstpreset.c @@ -116,9 +116,9 @@ static gboolean gst_preset_default_save_presets_file (GstPreset * preset); /* * preset_get_paths: * @preset: a #GObject that implements #GstPreset - * @preset_user_path: location for path or %NULL - * @preset_app_path: location for path or %NULL - * @preset_system_path: location for path or %NULL + * @preset_user_path: (out) (allow-none): location for path or %NULL + * @preset_app_path: (out) (allow-none): location for path or %NULL + * @preset_system_path: (out) (allow-none): location for path or %NULL * * Fetch the preset_path for user local, application specific and system wide * settings. Don't free after use. diff --git a/gst/gstquery.h b/gst/gstquery.h index 3750a19a1..18a075c03 100644 --- a/gst/gstquery.h +++ b/gst/gstquery.h @@ -276,8 +276,8 @@ gst_query_copy (const GstQuery * q) #define gst_query_make_writable(q) GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (q))) /** * gst_query_replace: - * @old_query: (inout) (transfer full): pointer to a pointer to a #GstQuery - * to be replaced. + * @old_query: (inout) (transfer full) (nullable): pointer to a pointer to a + * #GstQuery to be replaced. * @new_query: (allow-none) (transfer none): pointer to a #GstQuery that will * replace the query pointed to by @old_query. * diff --git a/gst/gsttoc.c b/gst/gsttoc.c index b1ab5338b..be99cb171 100644 --- a/gst/gsttoc.c +++ b/gst/gsttoc.c @@ -494,8 +494,10 @@ gst_toc_entry_set_start_stop_times (GstTocEntry * entry, gint64 start, /** * gst_toc_entry_get_start_stop_times: * @entry: #GstTocEntry to get values from. - * @start: (out): the storage for the start value, leave %NULL if not need. - * @stop: (out): the storage for the stop value, leave %NULL if not need. + * @start: (out) (allow-none): the storage for the start value, leave + * %NULL if not need. + * @stop: (out) (allow-none): the storage for the stop value, leave + * %NULL if not need. * * Get @start and @stop values from the @entry and write them into appropriate * storages. @@ -540,10 +542,10 @@ gst_toc_entry_set_loop (GstTocEntry * entry, GstTocLoopType loop_type, /** * gst_toc_entry_get_loop: * @entry: #GstTocEntry to get values from. - * @loop_type: (out): the storage for the loop_type value, leave %NULL if not - * need. - * @repeat_count: (out): the storage for the repeat_count value, leave %NULL if - * not need. + * @loop_type: (out) (allow-none): the storage for the loop_type + * value, leave %NULL if not need. + * @repeat_count: (out) (allow-none): the storage for the repeat_count + * value, leave %NULL if not need. * * Get @loop_type and @repeat_count values from the @entry and write them into * appropriate storages. Loops are e.g. used by sampled instruments. GStreamer diff --git a/gst/gstvalue.c b/gst/gstvalue.c index e6eacde6a..77e6fa10b 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -4785,8 +4785,10 @@ gst_value_can_intersect (const GValue * value1, const GValue * value2) /** * gst_value_intersect: - * @dest: (out caller-allocates) (transfer full): a uninitialized #GValue that will hold the calculated - * intersection value. May be %NULL if the resulting set if not needed. + * @dest: (out caller-allocates) (transfer full) (allow-none): + * a uninitialized #GValue that will hold the calculated + * intersection value. May be %NULL if the resulting set if not + * needed. * @value1: a value to intersect * @value2: another value to intersect * @@ -4870,9 +4872,10 @@ gst_value_register_intersect_func (GType type1, GType type2, /** * gst_value_subtract: - * @dest: (out caller-allocates): the destination value for the result if the - * subtraction is not empty. May be %NULL, in which case the resulting set - * will not be computed, which can give a fair speedup. + * @dest: (out caller-allocates) (allow-none): the destination value + * for the result if the subtraction is not empty. May be %NULL, + * in which case the resulting set will not be computed, which can + * give a fair speedup. * @minuend: the value to subtract from * @subtrahend: the value to subtract * -- cgit v1.2.3