summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a110e0)
raw | patch | inline | side by side (parent: 6a110e0)
author | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 2 Nov 2004 15:02:12 +0000 (15:02 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 2 Nov 2004 15:02:12 +0000 (15:02 +0000) |
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.
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.
12 files changed:
diff --git a/ChangeLog b/ChangeLog
index 0e6973dc25f285c9911a68e39e349b8e1d4c0494..fbaf6a22c72a292afc148cc289f9780f947bf97a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+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),
diff --git a/gst/cothreads.c b/gst/cothreads.c
index edc71e6798224edeac5db25d9ef1bc721b02a025..625e02a3c2089452865bbdd2c78ce66018acd993 100644 (file)
--- a/gst/cothreads.c
+++ b/gst/cothreads.c
cothread_create (cothread_context * ctx)
{
cothread_state *cothread;
- void *mmaped = 0;
+ void *mmaped = NULL;
gint slot = 0;
unsigned long page_size;
diff --git a/gst/gstbin.c b/gst/gstbin.c
index c6078ad2efee9f6f6b8780d42e9dfed65607d875..30d476fa5fbbd1f97ca34086741978c4de877992 100644 (file)
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
/* bump our internal state counter */
state = GST_STATE (element);
- while (state >>= 1)
+ while ((state >>= 1) != 0)
state_idx++;
bin->child_states[state_idx]++;
/* bump our internal state counter */
state = GST_STATE (element);
- while (state >>= 1)
+ while ((state >>= 1) != 0)
state_idx++;
bin->child_states[state_idx]--;
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);
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c
index 80ca7e162e7ae8f9dd80184f4d78f97383edc5c9..79015398f45e8e4f18047c5f687ac3149c585a56 100644 (file)
--- a/gst/gstbuffer.c
+++ b/gst/gstbuffer.c
{
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);
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 6bc8df949871156736882aa4ab2aed7395d78ec4..a1b7aaa0ff72d40a9afc4f3318faff1f774993fb 100644 (file)
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
{
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);
{
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);
return gst_pad_get_event_masks (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
{
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);
return gst_pad_get_query_types (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
{
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);
return gst_pad_get_formats (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
diff --git a/gst/gsterror.c b/gst/gsterror.c
index 2b4b2361ca2bbe477bf6fd028632d19d6b32a427..a8acb6b154766fa5fb4dee8a377816ab97d66474 100644 (file)
--- a/gst/gsterror.c
+++ b/gst/gsterror.c
/* initialize the dynamic table of translated core errors */
static gchar **
-_gst_core_errors_init ()
+_gst_core_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated library errors */
static gchar **
-_gst_library_errors_init ()
+_gst_library_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated resource errors */
static gchar **
-_gst_resource_errors_init ()
+_gst_resource_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated stream errors */
static gchar **
-_gst_stream_errors_init ()
+_gst_stream_errors_init (void)
{
gchar **t = NULL;
diff --git a/gst/gstobject.c b/gst/gstobject.c
index a12d876aa8f897da9e76ec1f455460479961c574..536c6f4c4b9a12fc07bae9f6839ab65cc6253b07 100644 (file)
--- a/gst/gstobject.c
+++ b/gst/gstobject.c
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) {
diff --git a/gst/gstpad.c b/gst/gstpad.c
index f801cbc31e7fbcb979857551df82a414881fbe3d..d60c9d38359ace684e23c34db57b6b0b9f0ac8ac 100644 (file)
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
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));
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;
diff --git a/gst/gstplugin.c b/gst/gstplugin.c
index a3b38fc6091f5ad5c91033e44c7fbd35a13107af..429853c724380fd518dffe440ccd6e86bd88ca1b 100644 (file)
--- a/gst/gstplugin.c
+++ b/gst/gstplugin.c
/* 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.
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)
if (GST_CAT_DEFAULT)
GST_INFO ("plugin \"%s\" failed to initialise", plugin->filename);
plugin->module = NULL;
- return FALSE;
+ return NULL;
}
if (GST_CAT_DEFAULT)
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;
}
diff --git a/gst/gststructure.c b/gst/gststructure.c
index 3cf6a4ee575cd7016bc895d6d34d6380a8e63ba7..b456c56c61927e9c4db81bb4afe61b939806c964 100644 (file)
--- a/gst/gststructure.c
+++ b/gst/gststructure.c
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);
}
diff --git a/gst/gstutils.c b/gst/gstutils.c
index 4df7e623c4c374468d953d8eb758e59dc9c77f2c..e00e23e612f093c8000a4318d692e5bb977f3882 100644 (file)
--- a/gst/gstutils.c
+++ b/gst/gstutils.c
{
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);
index da699b957cf936d533f0dd3c5c9d8f1db0161554..398e47dd9e085298b3d495625d5ceed0fdf3965c 100644 (file)
@@ -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;