Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris White <cxwembedded@gmail.com>2021-03-19 02:06:20 +0300
committerChris White <cxwembedded@gmail.com>2021-04-02 03:53:26 +0300
commita38d06cb1c1b25ba43edae8a9d81632a55ea24d5 (patch)
tree66efc84bbb4a254163239c4336bc0217ca194eed
parentc899d0a52c76972c64ef86a075314530a042ef8d (diff)
gst: Add missing G_GNUC_NULL_TERMINATED markers
Functions that require NULL as their last vararg are marked so the compiler can warn on missing NULL. Also, document the NULL terminator for gst_make_element_message_details() and gst_tracer_record_new(). https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/669 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774>
-rw-r--r--gst/gstcapsfeatures.h2
-rw-r--r--gst/gstelement.c3
-rw-r--r--gst/gstelement.h2
-rw-r--r--gst/gsttaglist.h2
-rw-r--r--gst/gsttracerrecord.c1
-rw-r--r--gst/gsttracerrecord.h2
-rw-r--r--gst/gsttypefind.h2
-rw-r--r--libs/gst/check/gstharness.h4
8 files changed, 10 insertions, 8 deletions
diff --git a/gst/gstcapsfeatures.h b/gst/gstcapsfeatures.h
index 97babb2716..aa5e72b042 100644
--- a/gst/gstcapsfeatures.h
+++ b/gst/gstcapsfeatures.h
@@ -58,7 +58,7 @@ GST_API
GstCapsFeatures * gst_caps_features_new_any (void);
GST_API
-GstCapsFeatures * gst_caps_features_new (const gchar *feature1, ...);
+GstCapsFeatures * gst_caps_features_new (const gchar *feature1, ...) G_GNUC_NULL_TERMINATED;
GST_API
GstCapsFeatures * gst_caps_features_new_valist (const gchar *feature1, va_list varargs);
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 13d586edf9..23b3f45191 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -3845,7 +3845,8 @@ _priv_gst_element_cleanup (void)
* @name: Name of the first field to set
* @...: variable arguments in the same form as #GstStructure
*
- * Create a #GstStructure to be used with #gst_element_message_full_with_details
+ * Create a #GstStructure to be used with #gst_element_message_full_with_details.
+ * %NULL terminator required.
*
* Since: 1.10
*/
diff --git a/gst/gstelement.h b/gst/gstelement.h
index 6b12ad2326..6740067ffe 100644
--- a/gst/gstelement.h
+++ b/gst/gstelement.h
@@ -484,7 +484,7 @@ typedef enum
#define GST_ELEMENT_START_TIME(elem) (GST_ELEMENT_CAST(elem)->start_time)
GST_API
-GstStructure *gst_make_element_message_details (const char *name, ...);
+GstStructure *gst_make_element_message_details (const char *name, ...) G_GNUC_NULL_TERMINATED;
#define GST_ELEMENT_MESSAGE_MAKE_DETAILS(args) gst_make_element_message_details args
diff --git a/gst/gsttaglist.h b/gst/gsttaglist.h
index 2df43c7254..c15ea2d34f 100644
--- a/gst/gsttaglist.h
+++ b/gst/gsttaglist.h
@@ -201,7 +201,7 @@ GST_API
GstTagList * gst_tag_list_new_empty (void) G_GNUC_MALLOC;
GST_API
-GstTagList * gst_tag_list_new (const gchar * tag, ...) G_GNUC_MALLOC;
+GstTagList * gst_tag_list_new (const gchar * tag, ...) G_GNUC_NULL_TERMINATED G_GNUC_MALLOC;
GST_API
GstTagList * gst_tag_list_new_valist (va_list var_args) G_GNUC_MALLOC;
diff --git a/gst/gsttracerrecord.c b/gst/gsttracerrecord.c
index 97d4c00019..1caa687135 100644
--- a/gst/gsttracerrecord.c
+++ b/gst/gsttracerrecord.c
@@ -159,6 +159,7 @@ gst_tracer_record_init (GstTracerRecord * self)
*
* Create a new tracer record. The record instance can be used to efficiently
* log entries using gst_tracer_record_log().
+ * %NULL terminator required after the last argument.
*
* The @name without the ".class" suffix will be used for the log records.
* There must be fields for each value that gets logged where the field name is
diff --git a/gst/gsttracerrecord.h b/gst/gsttracerrecord.h
index a7e1bb4b61..3d8c4da9c0 100644
--- a/gst/gsttracerrecord.h
+++ b/gst/gsttracerrecord.h
@@ -92,7 +92,7 @@ typedef enum
} GstTracerValueFlags;
GST_API
-GstTracerRecord * gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...);
+GstTracerRecord * gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...) G_GNUC_NULL_TERMINATED;
#ifndef GST_DISABLE_GST_DEBUG
GST_API
diff --git a/gst/gsttypefind.h b/gst/gsttypefind.h
index 6a0a63069f..7844adb649 100644
--- a/gst/gsttypefind.h
+++ b/gst/gsttypefind.h
@@ -196,7 +196,7 @@ GST_API
void gst_type_find_suggest_simple (GstTypeFind * find,
guint probability,
const char * media_type,
- const char * fieldname, ...);
+ const char * fieldname, ...) G_GNUC_NULL_TERMINATED;
GST_API
guint64 gst_type_find_get_length (GstTypeFind * find);
diff --git a/libs/gst/check/gstharness.h b/libs/gst/check/gstharness.h
index e4290d94c4..160fdb01d8 100644
--- a/libs/gst/check/gstharness.h
+++ b/libs/gst/check/gstharness.h
@@ -337,12 +337,12 @@ GstElement * gst_harness_find_element (GstHarness * h,
GST_CHECK_API
void gst_harness_set (GstHarness * h,
const gchar * element_name,
- const gchar * first_property_name, ...);
+ const gchar * first_property_name, ...) G_GNUC_NULL_TERMINATED;
GST_CHECK_API
void gst_harness_get (GstHarness * h,
const gchar * element_name,
- const gchar * first_property_name, ...);
+ const gchar * first_property_name, ...) G_GNUC_NULL_TERMINATED;
GST_CHECK_API
void gst_harness_add_probe (GstHarness * h,