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):
* plugins/elements/gstfdsrc.c: (gst_fd_src_update_fd):
Don't reset GstPollFDs, this is not necessary at all.
/***** 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
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)
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);
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;
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;
}
/**
* 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);
}
* 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);
}
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;
}
}
-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;
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
}
-GList *
+static GList *
gst_multi_queue_get_internal_links (GstPad * pad)
{
GList *res = NULL;
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);
#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,
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);
}
}
/*static guint gst_mem_index_signals[LAST_SIGNAL] = { 0 }; */
-GType
+static GType
gst_mem_index_get_type (void)
{
static GType mem_index_type = 0;
#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);
#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");
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");
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;
* 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;
#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;
#include <stdlib.h>
#include <gst/gst.h>
-gboolean playing;
-
static void
object_saved (GstObject * object, xmlNodePtr parent, gpointer data)
{
#include <stdlib.h>
#include <gst/gst.h>
-gboolean playing;
-
G_GNUC_UNUSED static void
xml_loaded (GstXML * xml, GstObject * object, xmlNodePtr self, gpointer data)
{
static int print_element_info (GstElementFactory * factory,
gboolean print_names);
-void
+static void
n_print (const char *format, ...)
{
va_list args;
*
* 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;