summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c483eb5)
raw | patch | inline | side by side (parent: c483eb5)
author | Sebastian Dröge <slomo@circular-chaos.org> | |
Fri, 29 Feb 2008 12:41:33 +0000 (12:41 +0000) | ||
committer | Sebastian Dröge <slomo@circular-chaos.org> | |
Fri, 29 Feb 2008 12:41:33 +0000 (12:41 +0000) |
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.
* 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.
25 files changed:
diff --git a/ChangeLog b/ChangeLog
index 35d798dddc21ccdc90184a44e0eaabd5646f8f3d..a78e635369f48b7e8c73e35f45267b466fd386a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2008-02-29 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * 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 <slomo@circular-chaos.org>
* plugins/elements/gstfdsink.c: (gst_fd_sink_update_fd):
diff --git a/gst/gstconfig.h.in b/gst/gstconfig.h.in
index af6de5c7b20b869c1650b2badf56ad2ab80f550a..85084c6789f5e23254d3f9b3b21a6641cf03a2b5 100644 (file)
--- a/gst/gstconfig.h.in
+++ b/gst/gstconfig.h.in
/***** 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
index dd936d7e184ff2fb05c8ce2345db8097711e98c3..5a930558aa017a2c8446fe59b1915fbdc751377c 100644 (file)
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)
index 0932bc94539b283ff60400c7519323639a1f4016..7a63e7f0cf6ad5b4be61046e91d9581ea7846c17 100644 (file)
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)
{
}
}
-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)
{
* Since: 0.10.18
*/
void
-gst_check_drop_buffers ()
+gst_check_drop_buffers (void)
{
GstBuffer *temp_buffer;
GstPad *pad_peer;
GstPad *sink_pad = NULL;
GstPad *src_pad;
+ GstBuffer *buffer;
/* check that there are no buffers waiting */
gst_check_drop_buffers ();
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);
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);
index 6ae5f5f03ca7286003ae6a0783080ef60e9f5573..b4dcc137b26ad4c54e881f077b3d3f9fa2e3728a 100644 (file)
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);
}
GType
-gst_controller_get_type ()
+gst_controller_get_type (void)
{
static GType type = 0;
index ff71ed2fcc20c2aae3af82929fe81c77a6bcb64b..52fda6c01af5588ed95b1e8147de8c638f4c06c9 100644 (file)
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);
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));
}
{
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 30e98660de7f233c89c9ac4d8787afcfc916116d..aef4286f9df0ff2247cb3c07679482a557047c6a 100644 (file)
* 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);
}
index 3680f39930104a61b572bd069effa063e7c14f04..7756cca67092924d948832162442ef2bd309462d 100644 (file)
* 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);
}
index b5dea2a1f9d1e4f3ae9223ab9c558b66324378af..8bdb9bcf8fdc56aac539439c8508293dd4c24205 100644 (file)
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:
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;
index fed8c63758bdec4ba00fdd97197c466426a3637f..bb5e58fcb1a4b1a8b786c8676a7213cec9bc0fe6 100644 (file)
}
}
-gboolean
+static gboolean
gst_fd_src_is_seekable (GstBaseSrc * bsrc)
{
GstFdSrc *src = GST_FD_SRC (bsrc);
return src->seekable_fd;
}
-gboolean
+static gboolean
gst_fd_src_get_size (GstBaseSrc * bsrc, guint64 * size)
{
GstFdSrc *src = GST_FD_SRC (bsrc);
}
}
-gboolean
+static gboolean
gst_fd_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment)
{
gint res;
index 9da5374a2ebf94bf478e10e23408868945c371a3..a6dd642e2f87cc6553a9582c110caae67f512a46 100644 (file)
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
}
-GList *
+static GList *
gst_multi_queue_get_internal_links (GstPad * pad)
{
GList *res = NULL;
index 5b5382e0f3a98828ae945690b4dc825a824bcf70..0369e9fdf53162d22dd395e52fa6269a5a78607e 100644 (file)
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);
index db2076084ff91448b3de82ac7bfcfbfff430d138..0a7f331aae7dfb0904d086ff46ec546ee36f3b56 100644 (file)
#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,
index 5c59c2be1121ee5fdc929fec0ccc9fdb0c116db2..f3500dfaa2b45f9084a0cf79e2f32b085e2680d5 100644 (file)
@@ -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;
GstFileIndexId *ii;
};
-void
+static void
_fi_find_writer (gpointer key, gpointer val, gpointer data)
{
struct fi_find_writer_context *cx = data;
_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;
}
{
- 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);
}
g_array_insert_vals (id_index->array, mx, row_data, 1);
+
+ g_free (row_data);
}
}
index 3bdc80d0fa67eb79ea7edf30de7ac0dbbb4f5b49..4261bb1e5ece590ae9ba9e066c61a868fb5b226c 100644 (file)
/*static guint gst_mem_index_signals[LAST_SIGNAL] = { 0 }; */
-GType
+static GType
gst_mem_index_get_type (void)
{
static GType mem_index_type = 0;
index 5ca53b0fd62fd48be445f4f16d1f6b3d9e4c0b52..6e745908b0a56e79336d70dc30e1345baef1e131 100644 (file)
#define MAX_THREADS 100
static void
-mess_some_more ()
+mess_some_more (void)
{
GList *walk;
gint random;
g_mutex_unlock (fdlock);
}
-void *
+static void *
run_test (void *threadid)
{
gint id = GPOINTER_TO_INT (threadid);
index 3072bb009c8fb772c8b2607e63a4902f86b33893..51148d4fcf62b6ac893317f68a5b3850b7619a0c 100644 (file)
#include <gst/check/gstcheck.h>
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,
g_mutex_unlock (check_mutex);
}
-GstElement *
-setup_queue ()
+static GstElement *
+setup_queue (void)
{
GstElement *queue;
return queue;
}
-void
+static void
cleanup_queue (GstElement * queue)
{
GST_DEBUG ("cleanup_queue");
GST_END_TEST;
-Suite *
+static Suite *
queue_suite (void)
{
Suite *s = suite_create ("queue");
index b009686bd177471a49790c3a69745e429e030f15..c344b03a8a64f5590642a92bdb9565752dbd16b6 100644 (file)
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);
GST_END_TEST;
-Suite *
+static Suite *
gst_pipeline_suite (void)
{
Suite *s = suite_create ("GstPipeline");
index 310fbbbe7b16644067c4136609d4ceb1a732ef76..4a66101121abe90c2839b115fabc79000f00a4b6 100644 (file)
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)
}
static void
-setup ()
+setup (void)
{
collect = gst_collect_pads_new ();
gst_collect_pads_set_function (collect, collected_cb, NULL);
}
static void
-teardown ()
+teardown (void)
{
gst_object_unref (sinkpad1);
gst_object_unref (sinkpad2);
GST_END_TEST;
static Suite *
-gst_collect_pads_suite ()
+gst_collect_pads_suite (void)
{
Suite *suite;
TCase *general;
index f32a00198a52fa7e458cc530dbfee5aa696b6365..a0781317b14b6ee97a6993a853ccaefd1f374396 100644 (file)
* 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},
* 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)
g_object_unref (adapter);
}
-void
+static void
run_tests (struct TestParams *params)
{
struct tms time_data;
index 7f3497af06c3b1665424d03d96e8fa2b77762279..730e450348a2e88000b6ab549b9cef32690efbed 100644 (file)
#include <locale.h>
#include <gst/gst.h>
-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
}
static void
-make_pipeline ()
+make_pipeline (void)
{
GstElement *decodebin;
index 5b7039bc2ce5adcd48e19680a45c299e2a1732fd..96ce9770e0d4382bc2090c3484b1087e48d2051c 100644 (file)
#include <stdlib.h>
#include <gst/gst.h>
-gboolean playing;
-
static void
object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
{
index c8d6189596782f46b2fdbc21c10f1fbad8f83ee3..b52307740678d147d7f03c1685f4eb51ee676535 100644 (file)
#include <stdlib.h>
#include <gst/gst.h>
-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 0c380f655572be67836aa379c65450b4a4c3053b..ec42c646d665203f7f99545ab5ef1897ad1de1d4 100644 (file)
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
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 36445d7ac2d95de935702b4497a4f06aeae045f9..4c6dee35b63355964a362f8fe84fb1a5eaa2d404 100644 (file)
--- a/tools/gst-run.c
+++ b/tools/gst-run.c
*
* The returned string is newly allocated.
*/
-gchar *
+static gchar *
get_dir_of_binary (const gchar * binary)
{
gchar *base, *dir;
/* 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;