From b997b0545a437613055e57587dcab420039d1eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 29 Feb 2008 12:41:33 +0000 Subject: [PATCH] Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static... Original commit message from CVS: * gst/gstconfig.h.in: * libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer): * libs/gst/check/gstcheck.c: (gst_check_log_message_func), (gst_check_log_critical_func), (gst_check_drop_buffers), (gst_check_element_push_buffer_list): * libs/gst/controller/gstcontroller.c: (gst_controller_get), (gst_controller_get_type): * libs/gst/controller/gsthelper.c: (gst_object_control_properties), (gst_object_get_controller), (gst_object_get_control_source): * libs/gst/controller/gstinterpolationcontrolsource.c: (gst_interpolation_control_source_new): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_new): * libs/gst/dataprotocol/dataprotocol.c: (gst_dp_event_from_packet_0_2): * plugins/elements/gstfdsrc.c: * plugins/elements/gstmultiqueue.c: * plugins/elements/gsttee.c: * plugins/elements/gsttypefindelement.c: * plugins/indexers/gstfileindex.c: (_file_index_id_save_xml), (gst_file_index_add_association): * plugins/indexers/gstmemindex.c: * tests/benchmarks/gstpollstress.c: (mess_some_more): * tests/check/elements/queue.c: (setup_queue): * tests/check/gst/gstpipeline.c: * tests/check/libs/collectpads.c: (setup), (teardown), (gst_collect_pads_suite): * tests/examples/adapter/adapter_test.c: * tests/examples/metadata/read-metadata.c: (make_pipeline): * tests/examples/xml/createxml.c: * tests/examples/xml/runxml.c: * tools/gst-inspect.c: * tools/gst-run.c: Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static, using NULL instead of 0 for pointers, not using variable sized arrays on the stack, moving variable declarations to the beginning of a block and using "foo (void)" instead of "foo ()" for declarations. --- ChangeLog | 41 +++++++++++++++++++ gst/gstconfig.h.in | 2 +- libs/gst/base/gstcollectpads.c | 6 +-- libs/gst/check/gstcheck.c | 14 ++++--- libs/gst/controller/gstcontroller.c | 4 +- libs/gst/controller/gsthelper.c | 8 ++-- .../gstinterpolationcontrolsource.c | 2 +- libs/gst/controller/gstlfocontrolsource.c | 2 +- libs/gst/dataprotocol/dataprotocol.c | 6 +-- plugins/elements/gstfdsrc.c | 6 +-- plugins/elements/gstmultiqueue.c | 2 +- plugins/elements/gsttee.c | 2 +- plugins/elements/gsttypefindelement.c | 4 +- plugins/indexers/gstfileindex.c | 10 +++-- plugins/indexers/gstmemindex.c | 2 +- tests/benchmarks/gstpollstress.c | 4 +- tests/check/elements/queue.c | 14 +++---- tests/check/gst/gstpipeline.c | 6 +-- tests/check/libs/collectpads.c | 10 ++--- tests/examples/adapter/adapter_test.c | 8 ++-- tests/examples/metadata/read-metadata.c | 8 ++-- tests/examples/xml/createxml.c | 2 - tests/examples/xml/runxml.c | 2 - tools/gst-inspect.c | 2 +- tools/gst-run.c | 4 +- 25 files changed, 107 insertions(+), 64 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35d798dddc..a78e635369 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2008-02-29 Sebastian Dröge + + * gst/gstconfig.h.in: + * libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer): + * libs/gst/check/gstcheck.c: (gst_check_log_message_func), + (gst_check_log_critical_func), (gst_check_drop_buffers), + (gst_check_element_push_buffer_list): + * libs/gst/controller/gstcontroller.c: (gst_controller_get), + (gst_controller_get_type): + * libs/gst/controller/gsthelper.c: (gst_object_control_properties), + (gst_object_get_controller), (gst_object_get_control_source): + * libs/gst/controller/gstinterpolationcontrolsource.c: + (gst_interpolation_control_source_new): + * libs/gst/controller/gstlfocontrolsource.c: + (gst_lfo_control_source_new): + * libs/gst/dataprotocol/dataprotocol.c: + (gst_dp_event_from_packet_0_2): + * plugins/elements/gstfdsrc.c: + * plugins/elements/gstmultiqueue.c: + * plugins/elements/gsttee.c: + * plugins/elements/gsttypefindelement.c: + * plugins/indexers/gstfileindex.c: (_file_index_id_save_xml), + (gst_file_index_add_association): + * plugins/indexers/gstmemindex.c: + * tests/benchmarks/gstpollstress.c: (mess_some_more): + * tests/check/elements/queue.c: (setup_queue): + * tests/check/gst/gstpipeline.c: + * tests/check/libs/collectpads.c: (setup), (teardown), + (gst_collect_pads_suite): + * tests/examples/adapter/adapter_test.c: + * tests/examples/metadata/read-metadata.c: (make_pipeline): + * tests/examples/xml/createxml.c: + * tests/examples/xml/runxml.c: + * tools/gst-inspect.c: + * tools/gst-run.c: + Correct all relevant warnings found by the sparse semantic code + analyzer. This include marking several symbols static, using + NULL instead of 0 for pointers, not using variable sized arrays + on the stack, moving variable declarations to the beginning of + a block and using "foo (void)" instead of "foo ()" for declarations. + 2008-02-29 Sebastian Dröge * plugins/elements/gstfdsink.c: (gst_fd_sink_update_fd): diff --git a/gst/gstconfig.h.in b/gst/gstconfig.h.in index af6de5c7b2..85084c6789 100644 --- a/gst/gstconfig.h.in +++ b/gst/gstconfig.h.in @@ -70,7 +70,7 @@ /***** default padding of structures *****/ #define GST_PADDING 4 -#define GST_PADDING_INIT {0} +#define GST_PADDING_INIT { NULL } /***** padding for very extensible base classes *****/ #define GST_PADDING_LARGE 20 diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index dd936d7e18..5a930558aa 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -865,9 +865,9 @@ gst_collect_pads_read_buffer (GstCollectPads * pads, GstCollectData * data, guint readsize; GstBuffer *buffer; - g_return_val_if_fail (pads != NULL, 0); - g_return_val_if_fail (GST_IS_COLLECT_PADS (pads), 0); - g_return_val_if_fail (data != NULL, 0); + g_return_val_if_fail (pads != NULL, NULL); + g_return_val_if_fail (GST_IS_COLLECT_PADS (pads), NULL); + g_return_val_if_fail (data != NULL, NULL); /* no buffer, must be EOS */ if ((buffer = data->buffer) == NULL) diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index 0932bc9453..7a63e7f0cf 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -48,12 +48,13 @@ GList *buffers = NULL; GMutex *check_mutex = NULL; GCond *check_cond = NULL; +/* FIXME 0.11: shouldn't _gst_check_debug be static? Not used anywhere */ gboolean _gst_check_debug = FALSE; gboolean _gst_check_raised_critical = FALSE; gboolean _gst_check_raised_warning = FALSE; gboolean _gst_check_expecting_log = FALSE; -void gst_check_log_message_func +static void gst_check_log_message_func (const gchar * log_domain, GLogLevelFlags log_level, const gchar * message, gpointer user_data) { @@ -62,7 +63,7 @@ void gst_check_log_message_func } } -void gst_check_log_critical_func +static void gst_check_log_critical_func (const gchar * log_domain, GLogLevelFlags log_level, const gchar * message, gpointer user_data) { @@ -280,7 +281,7 @@ gst_check_teardown_sink_pad (GstElement * element) * Since: 0.10.18 */ void -gst_check_drop_buffers () +gst_check_drop_buffers (void) { GstBuffer *temp_buffer; @@ -342,6 +343,7 @@ gst_check_element_push_buffer_list (const gchar * element_name, GstPad *pad_peer; GstPad *sink_pad = NULL; GstPad *src_pad; + GstBuffer *buffer; /* check that there are no buffers waiting */ gst_check_drop_buffers (); @@ -350,7 +352,7 @@ gst_check_element_push_buffer_list (const gchar * element_name, fail_if (element == NULL, "failed to create the element '%s'", element_name); fail_unless (GST_IS_ELEMENT (element), "the element is no element"); /* create the src pad */ - GstBuffer *buffer = GST_BUFFER (buffer_in->data); + buffer = GST_BUFFER (buffer_in->data); fail_unless (GST_IS_BUFFER (buffer), "There should be a buffer in buffer_in"); src_caps = GST_BUFFER_CAPS (buffer); @@ -366,11 +368,13 @@ gst_check_element_push_buffer_list (const gchar * element_name, GST_DEBUG ("src pad activated"); /* don't create the sink_pad if there is no buffer_out list */ if (buffer_out != NULL) { + gchar *temp; + GST_DEBUG ("buffer out detected, creating the sink pad"); /* get the sink caps */ sink_caps = GST_BUFFER_CAPS (GST_BUFFER (buffer_out->data)); fail_unless (GST_IS_CAPS (sink_caps), "buffer out don't have caps"); - gchar *temp = gst_caps_to_string (sink_caps); + temp = gst_caps_to_string (sink_caps); GST_DEBUG ("sink caps requested by buffer out: '%s'", temp); g_free (temp); diff --git a/libs/gst/controller/gstcontroller.c b/libs/gst/controller/gstcontroller.c index 6ae5f5f03c..b4dcc137b2 100644 --- a/libs/gst/controller/gstcontroller.c +++ b/libs/gst/controller/gstcontroller.c @@ -604,7 +604,7 @@ gst_controller_get (GstController * self, gchar * property_name, res = gst_control_source_get_value (prop->csource, timestamp, val); if (!res) { g_free (val); - val = FALSE; + val = NULL; } } else { g_object_get_property (self->object, prop->name, val); @@ -924,7 +924,7 @@ _gst_controller_class_init (GstControllerClass * klass) } GType -gst_controller_get_type () +gst_controller_get_type (void) { static GType type = 0; diff --git a/libs/gst/controller/gsthelper.c b/libs/gst/controller/gsthelper.c index ff71ed2fcc..52fda6c01a 100644 --- a/libs/gst/controller/gsthelper.c +++ b/libs/gst/controller/gsthelper.c @@ -64,7 +64,7 @@ gst_object_control_properties (GObject * object, ...) GstController *ctrl; va_list var_args; - g_return_val_if_fail (G_IS_OBJECT (object), FALSE); + g_return_val_if_fail (G_IS_OBJECT (object), NULL); va_start (var_args, object); ctrl = gst_controller_new_valist (object, var_args); @@ -115,7 +115,7 @@ gst_object_uncontrol_properties (GObject * object, ...) GstController * gst_object_get_controller (GObject * object) { - g_return_val_if_fail (G_IS_OBJECT (object), FALSE); + g_return_val_if_fail (G_IS_OBJECT (object), NULL); return (g_object_get_qdata (object, priv_gst_controller_key)); } @@ -238,12 +238,12 @@ gst_object_get_control_source (GObject * object, gchar * property_name) { GstController *ctrl = NULL; - g_return_val_if_fail (G_IS_OBJECT (object), FALSE); + g_return_val_if_fail (G_IS_OBJECT (object), NULL); if ((ctrl = g_object_get_qdata (object, priv_gst_controller_key))) { return gst_controller_get_control_source (ctrl, property_name); } - return FALSE; + return NULL; } /** diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c index 30e98660de..aef4286f9d 100644 --- a/libs/gst/controller/gstinterpolationcontrolsource.c +++ b/libs/gst/controller/gstinterpolationcontrolsource.c @@ -110,7 +110,7 @@ gst_interpolation_control_source_reset (GstInterpolationControlSource * self) * Returns: a new, unbound #GstInterpolationControlSource. */ GstInterpolationControlSource * -gst_interpolation_control_source_new () +gst_interpolation_control_source_new (void) { return g_object_new (GST_TYPE_INTERPOLATION_CONTROL_SOURCE, NULL); } diff --git a/libs/gst/controller/gstlfocontrolsource.c b/libs/gst/controller/gstlfocontrolsource.c index 3680f39930..7756cca670 100644 --- a/libs/gst/controller/gstlfocontrolsource.c +++ b/libs/gst/controller/gstlfocontrolsource.c @@ -564,7 +564,7 @@ gst_lfo_control_source_reset (GstLFOControlSource * self) * Returns: a new, unbound #GstLFOControlSource. */ GstLFOControlSource * -gst_lfo_control_source_new () +gst_lfo_control_source_new (void) { return g_object_new (GST_TYPE_LFO_CONTROL_SOURCE, NULL); } diff --git a/libs/gst/dataprotocol/dataprotocol.c b/libs/gst/dataprotocol/dataprotocol.c index b5dea2a1f9..8bdb9bcf8f 100644 --- a/libs/gst/dataprotocol/dataprotocol.c +++ b/libs/gst/dataprotocol/dataprotocol.c @@ -654,7 +654,7 @@ gst_dp_event_from_packet_0_2 (guint header_length, const guint8 * header, switch (type) { case GST_EVENT_UNKNOWN: GST_WARNING ("Unknown event, ignoring"); - return FALSE; + return NULL; case GST_EVENT_EOS: case GST_EVENT_FLUSH_START: case GST_EVENT_FLUSH_STOP: @@ -690,10 +690,10 @@ gst_dp_event_from_packet_0_2 (guint header_length, const guint8 * header, case GST_EVENT_NAVIGATION: case GST_EVENT_TAG: GST_WARNING ("Unhandled event type %d, ignoring", type); - return FALSE; + return NULL; default: GST_WARNING ("Unknown event type %d, ignoring", type); - return FALSE; + return NULL; } return event; diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index fed8c63758..bb5e58fcb1 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -411,7 +411,7 @@ read_error: } } -gboolean +static gboolean gst_fd_src_is_seekable (GstBaseSrc * bsrc) { GstFdSrc *src = GST_FD_SRC (bsrc); @@ -419,7 +419,7 @@ gst_fd_src_is_seekable (GstBaseSrc * bsrc) return src->seekable_fd; } -gboolean +static gboolean gst_fd_src_get_size (GstBaseSrc * bsrc, guint64 * size) { GstFdSrc *src = GST_FD_SRC (bsrc); @@ -445,7 +445,7 @@ could_not_stat: } } -gboolean +static gboolean gst_fd_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) { gint res; diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 9da5374a2e..a6dd642e2f 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -438,7 +438,7 @@ gst_multi_queue_get_property (GObject * object, guint prop_id, GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); } -GList * +static GList * gst_multi_queue_get_internal_links (GstPad * pad) { GList *res = NULL; diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 5b5382e0f3..0369e9fdf5 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -81,7 +81,7 @@ enum PROP_PULL_MODE, }; -GstStaticPadTemplate tee_src_template = GST_STATIC_PAD_TEMPLATE ("src%d", +static GstStaticPadTemplate tee_src_template = GST_STATIC_PAD_TEMPLATE ("src%d", GST_PAD_SRC, GST_PAD_REQUEST, GST_STATIC_CAPS_ANY); diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index db2076084f..0a7f331aae 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -64,13 +64,13 @@ GST_DEBUG_CATEGORY_STATIC (gst_type_find_element_debug); #define GST_CAT_DEFAULT gst_type_find_element_debug /* generic templates */ -GstStaticPadTemplate type_find_element_sink_template = +static GstStaticPadTemplate type_find_element_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); -GstStaticPadTemplate type_find_element_src_template = +static GstStaticPadTemplate type_find_element_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, diff --git a/plugins/indexers/gstfileindex.c b/plugins/indexers/gstfileindex.c index 5c59c2be11..f3500dfaa2 100644 --- a/plugins/indexers/gstfileindex.c +++ b/plugins/indexers/gstfileindex.c @@ -144,7 +144,7 @@ static GstIndexEntry *gst_file_index_get_assoc_entry (GstIndex * index, gint id, static GstIndex *parent_class = NULL; -GType +static GType gst_file_index_get_type (void) { static GType file_index_type = 0; @@ -261,7 +261,7 @@ struct fi_find_writer_context GstFileIndexId *ii; }; -void +static void _fi_find_writer (gpointer key, gpointer val, gpointer data) { struct fi_find_writer_context *cx = data; @@ -495,7 +495,7 @@ static void _file_index_id_save_xml (gpointer _key, GstFileIndexId * ii, xmlNodePtr writers) { const gint bufsize = 16; - gchar buf[bufsize]; + gchar buf[16]; xmlNodePtr writer; xmlNodePtr formats; gint xx; @@ -807,7 +807,7 @@ gst_file_index_add_association (GstIndex * index, GstIndexEntry * entry) } { - gchar row_data[ARRAY_ROW_SIZE (id_index)]; + gchar *row_data = (gchar *) g_malloc (ARRAY_ROW_SIZE (id_index)); gint fx; gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry); @@ -821,6 +821,8 @@ gst_file_index_add_association (GstIndex * index, GstIndexEntry * entry) } g_array_insert_vals (id_index->array, mx, row_data, 1); + + g_free (row_data); } } diff --git a/plugins/indexers/gstmemindex.c b/plugins/indexers/gstmemindex.c index 3bdc80d0fa..4261bb1e5e 100644 --- a/plugins/indexers/gstmemindex.c +++ b/plugins/indexers/gstmemindex.c @@ -120,7 +120,7 @@ static GstIndex *parent_class = NULL; /*static guint gst_mem_index_signals[LAST_SIGNAL] = { 0 }; */ -GType +static GType gst_mem_index_get_type (void) { static GType mem_index_type = 0; diff --git a/tests/benchmarks/gstpollstress.c b/tests/benchmarks/gstpollstress.c index 5ca53b0fd6..6e745908b0 100644 --- a/tests/benchmarks/gstpollstress.c +++ b/tests/benchmarks/gstpollstress.c @@ -29,7 +29,7 @@ static GTimer *timer; #define MAX_THREADS 100 static void -mess_some_more () +mess_some_more (void) { GList *walk; gint random; @@ -107,7 +107,7 @@ mess_some_more () g_mutex_unlock (fdlock); } -void * +static void * run_test (void *threadid) { gint id = GPOINTER_TO_INT (threadid); diff --git a/tests/check/elements/queue.c b/tests/check/elements/queue.c index 3072bb009c..51148d4fcf 100644 --- a/tests/check/elements/queue.c +++ b/tests/check/elements/queue.c @@ -25,13 +25,13 @@ #include GList *buffers = NULL; -gint overrun_count = 0; -gint underrun_count = 0; +static gint overrun_count = 0; +static gint underrun_count = 0; /* For ease of programming we use globals to keep refs for our floating * src and sink pads we create; otherwise we always have to do get_pad, * get_peer, and then remove references in every test function */ -GstPad *mysrcpad, *mysinkpad; +static GstPad *mysrcpad, *mysinkpad; static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, @@ -59,8 +59,8 @@ queue_underrun (GstElement * queue, gpointer user_data) g_mutex_unlock (check_mutex); } -GstElement * -setup_queue () +static GstElement * +setup_queue (void) { GstElement *queue; @@ -76,7 +76,7 @@ setup_queue () return queue; } -void +static void cleanup_queue (GstElement * queue) { GST_DEBUG ("cleanup_queue"); @@ -431,7 +431,7 @@ GST_START_TEST (test_time_level) GST_END_TEST; -Suite * +static Suite * queue_suite (void) { Suite *s = suite_create ("queue"); diff --git a/tests/check/gst/gstpipeline.c b/tests/check/gst/gstpipeline.c index b009686bd1..c344b03a8a 100644 --- a/tests/check/gst/gstpipeline.c +++ b/tests/check/gst/gstpipeline.c @@ -127,9 +127,9 @@ GST_START_TEST (test_get_bus) GST_END_TEST; -GMainLoop *loop = NULL; +static GMainLoop *loop = NULL; -gboolean +static gboolean message_received (GstBus * bus, GstMessage * message, gpointer data) { GstElement *pipeline = GST_ELEMENT (data); @@ -487,7 +487,7 @@ GST_START_TEST (test_base_time) GST_END_TEST; -Suite * +static Suite * gst_pipeline_suite (void) { Suite *s = suite_create ("GstPipeline"); diff --git a/tests/check/libs/collectpads.c b/tests/check/libs/collectpads.c index 310fbbbe7b..4a66101121 100644 --- a/tests/check/libs/collectpads.c +++ b/tests/check/libs/collectpads.c @@ -62,8 +62,8 @@ static GstPad *srcpad1, *srcpad2; static GstPad *sinkpad1, *sinkpad2; static TestData *data1, *data2; -GMutex *lock; -GCond *cond; +static GMutex *lock; +static GCond *cond; static GstFlowReturn collected_cb (GstCollectPads * pads, gpointer user_data) @@ -98,7 +98,7 @@ push_event (gpointer user_data) } static void -setup () +setup (void) { collect = gst_collect_pads_new (); gst_collect_pads_set_function (collect, collected_cb, NULL); @@ -118,7 +118,7 @@ setup () } static void -teardown () +teardown (void) { gst_object_unref (sinkpad1); gst_object_unref (sinkpad2); @@ -328,7 +328,7 @@ GST_START_TEST (test_collect_twice) GST_END_TEST; static Suite * -gst_collect_pads_suite () +gst_collect_pads_suite (void) { Suite *suite; TCase *general; diff --git a/tests/examples/adapter/adapter_test.c b/tests/examples/adapter/adapter_test.c index f32a00198a..a0781317b1 100644 --- a/tests/examples/adapter/adapter_test.c +++ b/tests/examples/adapter/adapter_test.c @@ -17,7 +17,7 @@ struct TestParams * them out in 'read size' sized pieces, using take and then take_buffer, * and prints the timings */ -struct TestParams param_sets[] = { +static struct TestParams param_sets[] = { /* These values put ~256MB in 1MB chunks in an adapter, then reads them out * in 250kb blocks */ {256000000, 250000, 1000000}, @@ -28,9 +28,9 @@ struct TestParams param_sets[] = { * in 1000 byte blocks */ {25600000, 1000, 200} }; -const gint n_tests = sizeof (param_sets) / sizeof (struct TestParams); +static const gint n_tests = sizeof (param_sets) / sizeof (struct TestParams); -gint ticks_per_sec; +static gint ticks_per_sec; static void run_test_take (struct TestParams *params) @@ -88,7 +88,7 @@ run_test_take_buffer (struct TestParams *params) g_object_unref (adapter); } -void +static void run_tests (struct TestParams *params) { struct tms time_data; diff --git a/tests/examples/metadata/read-metadata.c b/tests/examples/metadata/read-metadata.c index 7f3497af06..730e450348 100644 --- a/tests/examples/metadata/read-metadata.c +++ b/tests/examples/metadata/read-metadata.c @@ -32,9 +32,9 @@ #include #include -char *filename = NULL; -GstElement *pipeline = NULL; -GstElement *source = NULL; +static char *filename = NULL; +static GstElement *pipeline = NULL; +static GstElement *source = NULL; #define NEW_PIPE_PER_FILE @@ -82,7 +82,7 @@ message_loop (GstElement * element, GstTagList ** tags) } static void -make_pipeline () +make_pipeline (void) { GstElement *decodebin; diff --git a/tests/examples/xml/createxml.c b/tests/examples/xml/createxml.c index 5b7039bc2c..96ce9770e0 100644 --- a/tests/examples/xml/createxml.c +++ b/tests/examples/xml/createxml.c @@ -1,8 +1,6 @@ #include #include -gboolean playing; - static void object_saved (GstObject * object, xmlNodePtr parent, gpointer data) { diff --git a/tests/examples/xml/runxml.c b/tests/examples/xml/runxml.c index c8d6189596..b523077406 100644 --- a/tests/examples/xml/runxml.c +++ b/tests/examples/xml/runxml.c @@ -2,8 +2,6 @@ #include #include -gboolean playing; - G_GNUC_UNUSED static void xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data) { diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index 0c380f6555..ec42c646d6 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -38,7 +38,7 @@ static char *_name = NULL; static int print_element_info (GstElementFactory * factory, gboolean print_names); -void +static void n_print (const char *format, ...) { va_list args; diff --git a/tools/gst-run.c b/tools/gst-run.c index 36445d7ac2..4c6dee35b6 100644 --- a/tools/gst-run.c +++ b/tools/gst-run.c @@ -147,7 +147,7 @@ unmangle_libtool (gchar ** dir, gchar ** base) * * The returned string is newly allocated. */ -gchar * +static gchar * get_dir_of_binary (const gchar * binary) { gchar *base, *dir; @@ -192,7 +192,7 @@ get_dir_of_binary (const gchar * binary) /* Search the given directory for candidate binaries matching the base binary. * Return a GHashTable of major/minor -> directory pairs */ -GHashTable * +static GHashTable * get_candidates (const gchar * dir, const gchar * base) { GDir *gdir;