mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
gst/: Aplied part of patch #157127: Cleanup of issues reported by sparse.
Original commit message from CVS: reviewed by: Wim Taymans, Ronald Bultje. * gst/cothreads.c: (cothread_create): * gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func), (gst_bin_child_state_change_func): * gst/gstbuffer.c: (gst_buffer_span): * gst/gstelement.c: (gst_element_get_index), (gst_element_get_event_masks), (gst_element_get_query_types), (gst_element_get_formats): * gst/gsterror.c: (_gst_core_errors_init), (_gst_library_errors_init), (_gst_resource_errors_init), (_gst_stream_errors_init): * gst/gstobject.c: (gst_object_default_deep_notify): * gst/gstpad.c: (gst_pad_get_event_masks), (gst_pad_get_internal_links_default): * gst/gstplugin.c: (gst_plugin_register_func), (gst_plugin_get_module): * gst/gststructure.c: (gst_structure_get_string), (gst_structure_get_abbrs), (gst_structure_from_abbr), (gst_structure_to_abbr): * gst/gstutils.c: (gst_print_element_args): * gst/schedulers/gstoptimalscheduler.c: (add_to_group), (setup_group_scheduler), (gst_opt_scheduler_iterate): Aplied part of patch #157127: Cleanup of issues reported by sparse. Also do not try to use cothreads when there is no cothread context yet.
This commit is contained in:
parent
6a110e062f
commit
6d42edd550
12 changed files with 70 additions and 36 deletions
30
ChangeLog
30
ChangeLog
|
@ -1,3 +1,33 @@
|
|||
2004-11-02 Kjartan Maraas <as at gnome.org>
|
||||
|
||||
reviewed by: Wim Taymans, Ronald Bultje.
|
||||
|
||||
* gst/cothreads.c: (cothread_create):
|
||||
* gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
|
||||
(gst_bin_child_state_change_func):
|
||||
* gst/gstbuffer.c: (gst_buffer_span):
|
||||
* gst/gstelement.c: (gst_element_get_index),
|
||||
(gst_element_get_event_masks), (gst_element_get_query_types),
|
||||
(gst_element_get_formats):
|
||||
* gst/gsterror.c: (_gst_core_errors_init),
|
||||
(_gst_library_errors_init), (_gst_resource_errors_init),
|
||||
(_gst_stream_errors_init):
|
||||
* gst/gstobject.c: (gst_object_default_deep_notify):
|
||||
* gst/gstpad.c: (gst_pad_get_event_masks),
|
||||
(gst_pad_get_internal_links_default):
|
||||
* gst/gstplugin.c: (gst_plugin_register_func),
|
||||
(gst_plugin_get_module):
|
||||
* gst/gststructure.c: (gst_structure_get_string),
|
||||
(gst_structure_get_abbrs), (gst_structure_from_abbr),
|
||||
(gst_structure_to_abbr):
|
||||
* gst/gstutils.c: (gst_print_element_args):
|
||||
* gst/schedulers/gstoptimalscheduler.c: (add_to_group),
|
||||
(setup_group_scheduler), (gst_opt_scheduler_iterate):
|
||||
Aplied part of patch #157127: Cleanup of issues reported by
|
||||
sparse.
|
||||
Also do not try to use cothreads when there is no cothread
|
||||
context yet.
|
||||
|
||||
2004-11-02 Sebastien Cote <sc5 at hermes.usherb.ca>
|
||||
|
||||
* gst/schedulers/gstoptimalscheduler.c: (add_to_group),
|
||||
|
|
|
@ -224,7 +224,7 @@ cothread_state *
|
|||
cothread_create (cothread_context * ctx)
|
||||
{
|
||||
cothread_state *cothread;
|
||||
void *mmaped = 0;
|
||||
void *mmaped = NULL;
|
||||
gint slot = 0;
|
||||
unsigned long page_size;
|
||||
|
||||
|
|
|
@ -485,7 +485,7 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
|
|||
|
||||
/* bump our internal state counter */
|
||||
state = GST_STATE (element);
|
||||
while (state >>= 1)
|
||||
while ((state >>= 1) != 0)
|
||||
state_idx++;
|
||||
bin->child_states[state_idx]++;
|
||||
|
||||
|
@ -558,7 +558,7 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
|
|||
|
||||
/* bump our internal state counter */
|
||||
state = GST_STATE (element);
|
||||
while (state >>= 1)
|
||||
while ((state >>= 1) != 0)
|
||||
state_idx++;
|
||||
bin->child_states[state_idx]--;
|
||||
|
||||
|
@ -691,9 +691,9 @@ gst_bin_child_state_change_func (GstBin * bin, GstElementState oldstate,
|
|||
|
||||
old = oldstate;
|
||||
new = newstate;
|
||||
while (old >>= 1)
|
||||
while ((old >>= 1) != 0)
|
||||
old_idx++;
|
||||
while (new >>= 1)
|
||||
while ((new >>= 1) != 0)
|
||||
new_idx++;
|
||||
|
||||
GST_LOCK (bin);
|
||||
|
|
|
@ -435,7 +435,7 @@ gst_buffer_span (GstBuffer * buf1, guint32 offset, GstBuffer * buf2,
|
|||
{
|
||||
GstBuffer *newbuf;
|
||||
|
||||
g_return_val_if_fail (buf1 != NULL && buf2 != NULL, FALSE);
|
||||
g_return_val_if_fail (buf1 != NULL && buf2 != NULL, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf1) > 0, NULL);
|
||||
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf2) > 0, NULL);
|
||||
g_return_val_if_fail (len > 0, NULL);
|
||||
|
|
|
@ -1058,7 +1058,7 @@ gst_element_get_index (GstElement * element)
|
|||
{
|
||||
GstElementClass *oclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
|
@ -2255,7 +2255,7 @@ gst_element_get_event_masks (GstElement * element)
|
|||
{
|
||||
GstElementClass *oclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
|
@ -2268,7 +2268,7 @@ gst_element_get_event_masks (GstElement * element)
|
|||
return gst_pad_get_event_masks (GST_PAD_PEER (pad));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2341,7 +2341,7 @@ gst_element_get_query_types (GstElement * element)
|
|||
{
|
||||
GstElementClass *oclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
|
@ -2354,7 +2354,7 @@ gst_element_get_query_types (GstElement * element)
|
|||
return gst_pad_get_query_types (GST_PAD_PEER (pad));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2414,7 +2414,7 @@ gst_element_get_formats (GstElement * element)
|
|||
{
|
||||
GstElementClass *oclass;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
|
||||
|
||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||
|
||||
|
@ -2427,7 +2427,7 @@ gst_element_get_formats (GstElement * element)
|
|||
return gst_pad_get_formats (GST_PAD_PEER (pad));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,7 @@ gst_g_error_get_type (void)
|
|||
|
||||
/* initialize the dynamic table of translated core errors */
|
||||
static gchar **
|
||||
_gst_core_errors_init ()
|
||||
_gst_core_errors_init (void)
|
||||
{
|
||||
gchar **t = NULL;
|
||||
|
||||
|
@ -83,7 +83,7 @@ _gst_core_errors_init ()
|
|||
|
||||
/* initialize the dynamic table of translated library errors */
|
||||
static gchar **
|
||||
_gst_library_errors_init ()
|
||||
_gst_library_errors_init (void)
|
||||
{
|
||||
gchar **t = NULL;
|
||||
|
||||
|
@ -103,7 +103,7 @@ _gst_library_errors_init ()
|
|||
|
||||
/* initialize the dynamic table of translated resource errors */
|
||||
static gchar **
|
||||
_gst_resource_errors_init ()
|
||||
_gst_resource_errors_init (void)
|
||||
{
|
||||
gchar **t = NULL;
|
||||
|
||||
|
@ -133,7 +133,7 @@ _gst_resource_errors_init ()
|
|||
|
||||
/* initialize the dynamic table of translated stream errors */
|
||||
static gchar **
|
||||
_gst_stream_errors_init ()
|
||||
_gst_stream_errors_init (void)
|
||||
{
|
||||
gchar **t = NULL;
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ gst_object_default_deep_notify (GObject * object, GstObject * orig,
|
|||
GParamSpec * pspec, gchar ** excluded_props)
|
||||
{
|
||||
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
||||
gchar *str = 0;
|
||||
gchar *str = NULL;
|
||||
gchar *name = NULL;
|
||||
|
||||
if (pspec->flags & G_PARAM_READABLE) {
|
||||
|
|
|
@ -626,7 +626,7 @@ gst_pad_get_event_masks (GstPad * pad)
|
|||
|
||||
rpad = GST_PAD_REALIZE (pad);
|
||||
|
||||
g_return_val_if_fail (rpad, FALSE);
|
||||
g_return_val_if_fail (rpad, NULL);
|
||||
|
||||
if (GST_RPAD_EVENTMASKFUNC (rpad))
|
||||
return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD (pad));
|
||||
|
@ -3897,7 +3897,7 @@ gst_pad_get_internal_links_default (GstPad * pad)
|
|||
GstPadDirection direction;
|
||||
GstRealPad *rpad;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
|
||||
|
||||
rpad = GST_PAD_REALIZE (pad);
|
||||
direction = rpad->direction;
|
||||
|
|
|
@ -50,10 +50,10 @@ static GList *_gst_plugin_static = NULL;
|
|||
|
||||
/* static variables for segfault handling of plugin loading */
|
||||
static char *_gst_plugin_fault_handler_filename = NULL;
|
||||
extern gboolean *_gst_disable_segtrap; /* see gst.c */
|
||||
extern gboolean _gst_disable_segtrap; /* see gst.c */
|
||||
|
||||
#ifndef HAVE_WIN32
|
||||
static gboolean *_gst_plugin_fault_handler_is_setup = FALSE;
|
||||
static gboolean _gst_plugin_fault_handler_is_setup = FALSE;
|
||||
#endif
|
||||
|
||||
/* list of valid licenses.
|
||||
|
@ -187,21 +187,21 @@ gst_plugin_register_func (GstPlugin * plugin, GModule * module,
|
|||
if (GST_CAT_DEFAULT)
|
||||
GST_INFO ("plugin \"%s\" has incompatible version, not loading",
|
||||
plugin->filename);
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!desc->license || !desc->description || !desc->package || !desc->origin) {
|
||||
if (GST_CAT_DEFAULT)
|
||||
GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading",
|
||||
plugin->filename);
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gst_plugin_check_license (desc->license)) {
|
||||
if (GST_CAT_DEFAULT)
|
||||
GST_INFO ("plugin \"%s\" has invalid license \"%s\", not loading",
|
||||
plugin->filename, desc->license);
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (GST_CAT_DEFAULT)
|
||||
|
@ -214,7 +214,7 @@ gst_plugin_register_func (GstPlugin * plugin, GModule * module,
|
|||
if (GST_CAT_DEFAULT)
|
||||
GST_INFO ("plugin \"%s\" failed to initialise", plugin->filename);
|
||||
plugin->module = NULL;
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (GST_CAT_DEFAULT)
|
||||
|
@ -639,7 +639,7 @@ gst_plugin_get_origin (GstPlugin * plugin)
|
|||
GModule *
|
||||
gst_plugin_get_module (GstPlugin * plugin)
|
||||
{
|
||||
g_return_val_if_fail (plugin != NULL, FALSE);
|
||||
g_return_val_if_fail (plugin != NULL, NULL);
|
||||
|
||||
return plugin->module;
|
||||
}
|
||||
|
|
|
@ -973,9 +973,9 @@ gst_structure_get_string (const GstStructure * structure,
|
|||
field = gst_structure_get_field (structure, fieldname);
|
||||
|
||||
if (field == NULL)
|
||||
return FALSE;
|
||||
return NULL;
|
||||
if (!G_VALUE_HOLDS_STRING (&field->value))
|
||||
return FALSE;
|
||||
return NULL;
|
||||
|
||||
return g_value_get_string (&field->value);
|
||||
}
|
||||
|
|
|
@ -332,7 +332,7 @@ gst_print_element_args (GString * buf, gint indent, GstElement * element)
|
|||
{
|
||||
guint width;
|
||||
GValue value = { 0, }; /* the important thing is that value.type = 0 */
|
||||
gchar *str = 0;
|
||||
gchar *str = NULL;
|
||||
GParamSpec *spec, **specs, **walk;
|
||||
|
||||
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element), NULL);
|
||||
|
|
|
@ -1017,12 +1017,16 @@ setup_group_scheduler (GstOptScheduler * osched, GstOptSchedulerGroup * group)
|
|||
wrapper = loop_group_schedule_function;
|
||||
|
||||
#ifdef USE_COTHREADS
|
||||
if (!(group->flags & GST_OPT_SCHEDULER_GROUP_SCHEDULABLE)) {
|
||||
do_cothread_create (group->cothread, osched->context,
|
||||
(cothread_func) wrapper, 0, (char **) group);
|
||||
} else {
|
||||
do_cothread_setfunc (group->cothread, osched->context,
|
||||
(cothread_func) wrapper, 0, (char **) group);
|
||||
/* we can only initialize the cothread stuff when we have
|
||||
* a cothread context */
|
||||
if (osched->context) {
|
||||
if (!(group->flags & GST_OPT_SCHEDULER_GROUP_SCHEDULABLE)) {
|
||||
do_cothread_create (group->cothread, osched->context,
|
||||
(cothread_func) wrapper, 0, (char **) group);
|
||||
} else {
|
||||
do_cothread_setfunc (group->cothread, osched->context,
|
||||
(cothread_func) wrapper, 0, (char **) group);
|
||||
}
|
||||
}
|
||||
#else
|
||||
group->schedulefunc = wrapper;
|
||||
|
|
Loading…
Reference in a new issue