Commit 8b29840f authored by Joshua N. Pritikin's avatar Joshua N. Pritikin
Browse files

1. Add more warnings for the gst core only. Various trival fixes to quiet the warnings.

Original commit message from CVS:
1. Add more warnings for the gst core only.  Various trival fixes
to quiet the warnings.

2. Fix GstBufferCopyFunc prototype.

3. Re-apply the reverted type!=0 assertion in gst_elementfactory_new.
parent 4934137e
......@@ -201,7 +201,13 @@ CFLAGS = \
$(LIBGST_CFLAGS) \
-D_GNU_SOURCE \
-DG_LOG_DOMAIN=g_log_domain_gstreamer \
-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\"
-DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" \
\
-W -Wpointer-arith -Wbad-function-cast \
-Wcast-align -Wsign-compare \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs \
-Winline -Wno-unused
LIBS = $(LIBGST_LIBS)
LDFLAGS = ""
......
......@@ -66,7 +66,7 @@ struct _cothread_state {
};
cothread_context* cothread_init();
cothread_context* cothread_init (void);
cothread_state* cothread_create (cothread_context *ctx);
void cothread_setfunc (cothread_state *thread, cothread_func func,
int argc, char **argv);
......
......@@ -58,6 +58,7 @@ GType gst_autoplug_get_type(void)
sizeof(GstAutoplug),
4,
(GInstanceInitFunc)gst_autoplug_init,
NULL
};
autoplug_type = g_type_register_static (GST_TYPE_OBJECT, "GstAutoplug", &autoplug_info, G_TYPE_FLAG_ABSTRACT);
}
......@@ -189,6 +190,7 @@ gst_autoplugfactory_get_type (void)
sizeof(GstAutoplugFactory),
0,
(GInstanceInitFunc) gst_autoplugfactory_init,
NULL
};
autoplugfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"GstAutoplugFactory", &autoplugfactory_info, 0);
......
......@@ -87,6 +87,7 @@ gst_bin_get_type (void)
sizeof(GstBin),
8,
(GInstanceInitFunc)gst_bin_init,
NULL
};
bin_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBin", &bin_info, 0);
}
......@@ -170,7 +171,7 @@ gst_bin_reset_element_sched (GstElement *element, GstSchedule *sched)
// GST_SCHEDULE_ADD_ELEMENT (sched, element);
}
void
static void
gst_bin_set_element_sched (GstElement *element,GstSchedule *sched)
{
GList *children;
......@@ -211,7 +212,7 @@ gst_bin_set_element_sched (GstElement *element,GstSchedule *sched)
}
void
static void
gst_bin_unset_element_sched (GstElement *element)
{
GList *children;
......
......@@ -357,7 +357,7 @@ gst_buffer_copy (GstBuffer *buffer)
// if a copy function exists, use it, else copy the bytes
if (buffer->copy != NULL) {
(buffer->copy)(buffer,newbuf);
newbuf = (buffer->copy)(buffer);
} else {
// copy the absolute size
newbuf->size = buffer->size;
......
......@@ -86,8 +86,8 @@ typedef enum {
typedef struct _GstBuffer GstBuffer;
typedef void (*GstBufferFreeFunc) (GstBuffer *buf);
typedef void (*GstBufferCopyFunc) (GstBuffer *srcbuf,GstBuffer *dstbuf);
typedef void (*GstBufferFreeFunc) (GstBuffer *buf);
typedef GstBuffer *(*GstBufferCopyFunc) (GstBuffer *srcbuf);
#include <gst/gstbufferpool.h>
......
......@@ -194,7 +194,8 @@ gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool,
* @destroy: the copy function
*
* Sets the function that will be called when a buffer is copied.
* You can use the default GstBuffer implementation (gst_buffer_copy) if you like.
*
* You may use the default GstBuffer implementation (gst_buffer_copy).
*/
void
gst_buffer_pool_set_buffer_copy_function (GstBufferPool *pool,
......
......@@ -83,6 +83,7 @@ GType gst_element_get_type(void) {
sizeof(GstElement),
0,
(GInstanceInitFunc)gst_element_init,
NULL
};
element_type = g_type_register_static(GST_TYPE_OBJECT, "GstElement", &element_info, G_TYPE_FLAG_ABSTRACT);
}
......
......@@ -57,6 +57,7 @@ gst_elementfactory_get_type (void)
sizeof(GstElementFactory),
0,
(GInstanceInitFunc) gst_elementfactory_init,
NULL
};
elementfactory_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
"GstElementFactory", &elementfactory_info, 0);
......@@ -176,6 +177,7 @@ gst_elementfactory_new (const gchar *name, GType type,
GstElementFactory *factory;
g_return_val_if_fail(name != NULL, NULL);
g_return_val_if_fail (type, NULL);
g_return_val_if_fail (details, NULL);
factory = gst_elementfactory_find (name);
......
......@@ -41,6 +41,7 @@ gst_extra_get_filename_type (void)
0, //sizeof(GstElement),
0,
NULL,
NULL
};
filename_type = g_type_register_static (G_TYPE_STRING, "GstFilename", &filename_info, 0);
}
......
......@@ -78,6 +78,7 @@ gst_object_get_type (void)
sizeof (GstObject),
32,
(GInstanceInitFunc) gst_object_init,
NULL
};
object_type = g_type_register_static (G_TYPE_OBJECT, "GstObject", &object_info, G_TYPE_FLAG_ABSTRACT);
}
......@@ -608,6 +609,7 @@ gst_signal_object_get_type (void)
sizeof(GstSignalObject),
16,
(GInstanceInitFunc)gst_signal_object_init,
NULL
};
signal_object_type = g_type_register_static(G_TYPE_OBJECT, "GstSignalObject", &signal_object_info, 0);
}
......
......@@ -55,6 +55,7 @@ gst_pad_get_type(void) {
sizeof(GstPad),
32,
(GInstanceInitFunc)gst_pad_init,
NULL
};
pad_type = g_type_register_static(GST_TYPE_OBJECT, "GstPad", &pad_info, 0);
}
......@@ -124,6 +125,7 @@ gst_real_pad_get_type(void) {
sizeof(GstRealPad),
32,
(GInstanceInitFunc)gst_real_pad_init,
NULL
};
pad_type = g_type_register_static(GST_TYPE_PAD, "GstRealPad", &pad_info, 0);
}
......@@ -1442,7 +1444,9 @@ gst_pad_push (GstPad *pad, GstBuffer *buf)
GST_DEBUG_FUNCPTR_NAME (peer->chainhandler), GST_DEBUG_PAD_NAME (((GstPad*)peer)));
(peer->chainhandler) (((GstPad*)peer), buf);
} else
GST_DEBUG (GST_CAT_DATAFLOW, "no chainhandler\n");
{
GST_DEBUG (GST_CAT_DATAFLOW, "no chainhandler\n");
}
}
#endif
......@@ -1633,6 +1637,7 @@ gst_padtemplate_get_type (void)
sizeof(GstPadTemplate),
32,
(GInstanceInitFunc)gst_padtemplate_init,
NULL
};
padtemplate_type = g_type_register_static(GST_TYPE_OBJECT, "GstPadTemplate", &padtemplate_info, 0);
}
......@@ -1882,6 +1887,7 @@ gst_ghost_pad_get_type(void) {
sizeof(GstGhostPad),
8,
(GInstanceInitFunc)gst_ghost_pad_init,
NULL
};
pad_type = g_type_register_static(GST_TYPE_PAD, "GstGhostPad", &pad_info, 0);
}
......
......@@ -400,6 +400,9 @@ GstCaps* gst_padtemplate_get_caps_by_name (GstPadTemplate *templ, const gchar *
xmlNodePtr gst_padtemplate_save_thyself (GstPadTemplate *templ, xmlNodePtr parent);
GstPadTemplate* gst_padtemplate_load_thyself (xmlNodePtr parent);
xmlNodePtr gst_pad_ghost_save_thyself (GstPad *pad,
GstElement *bin,
xmlNodePtr parent);
#ifdef __cplusplus
}
......
......@@ -88,9 +88,11 @@ dynamic_connect (GstElement *element, GstPad *newpad, gpointer data)
static gchar *
gst_parse_unique_name(gchar *type,gst_parse_priv *priv)
{
gpointer tmp;
gint count;
count = GPOINTER_TO_INT(g_hash_table_lookup(priv->elementcounts,type));
tmp = g_hash_table_lookup (priv->elementcounts,type);
count = GPOINTER_TO_INT (tmp);
count++;
g_hash_table_insert(priv->elementcounts,type,GINT_TO_POINTER(count));
......@@ -467,9 +469,10 @@ GST_DEBUG_PAD_NAME(temppad),GST_ELEMENT_NAME (parent),GST_PAD_NAME(temppad));
if (retval) return retval;
if (closingchar != '\0')
DEBUG("returning IN THE WRONG PLACE\n");
else DEBUG("ending pipeline\n");
DEBUG (closingchar != '\0'?
"returning IN THE WRONG PLACE\n" :
"ending pipeline\n");
return i+1;
}
......
......@@ -75,6 +75,7 @@ gst_pipeline_get_type (void) {
sizeof(GstPipeline),
0,
(GInstanceInitFunc)gst_pipeline_init,
NULL
};
pipeline_type = g_type_register_static (GST_TYPE_BIN, "GstPipeline", &pipeline_info, 0);
}
......
......@@ -674,7 +674,7 @@ gst_plugin_find_feature_func (GstPlugin *plugin, const gchar *name, GType type)
return NULL;
}
GstPluginFeature*
static GstPluginFeature*
gst_plugin_find_feature (const gchar *name, GType type)
{
GList *plugins;
......
......@@ -51,6 +51,7 @@ gst_plugin_feature_get_type (void)
sizeof (GstObject),
32,
(GInstanceInitFunc) gst_plugin_feature_init,
NULL
};
plugin_feature_type = g_type_register_static (GST_TYPE_OBJECT, "GstPluginFeature",
&plugin_feature_info, G_TYPE_FLAG_ABSTRACT);
......
......@@ -121,6 +121,7 @@ gst_queue_get_type(void)
sizeof(GstQueue),
4,
(GInstanceInitFunc)gst_queue_init,
NULL
};
queue_type = g_type_register_static (GST_TYPE_ELEMENT, "GstQueue", &queue_info, 0);
}
......
......@@ -842,6 +842,7 @@ GType gst_schedule_get_type(void) {
sizeof(GstSchedule),
0,
(GInstanceInitFunc)gst_schedule_init,
NULL
};
schedule_type = g_type_register_static(GST_TYPE_OBJECT, "GstSchedule", &schedule_info, 0);
}
......@@ -910,7 +911,7 @@ GstElement *gst_schedule_check_pad (GstSchedule *sched, GstPad *pad) {
}
*/
GstScheduleChain *
static GstScheduleChain *
gst_schedule_chain_new (GstSchedule *sched)
{
GstScheduleChain *chain = g_new (GstScheduleChain, 1);
......@@ -934,7 +935,7 @@ gst_schedule_chain_new (GstSchedule *sched)
return chain;
}
void
static void
gst_schedule_chain_destroy (GstScheduleChain *chain)
{
GstSchedule *sched = chain->sched;
......@@ -951,7 +952,7 @@ gst_schedule_chain_destroy (GstScheduleChain *chain)
GST_INFO (GST_CAT_SCHEDULING, "destroyed chain %p, now are %d chains in sched %p",chain,sched->num_chains,sched);
}
void
static void
gst_schedule_chain_add_element (GstScheduleChain *chain, GstElement *element)
{
GST_INFO (GST_CAT_SCHEDULING, "adding element \"%s\" to chain %p", GST_ELEMENT_NAME (element),chain);
......@@ -964,7 +965,7 @@ gst_schedule_chain_add_element (GstScheduleChain *chain, GstElement *element)
chain->num_elements++;
}
void
static void
gst_schedule_chain_enable_element (GstScheduleChain *chain, GstElement *element)
{
GST_INFO (GST_CAT_SCHEDULING, "enabling element \"%s\" in chain %p", GST_ELEMENT_NAME (element),chain);
......@@ -979,7 +980,7 @@ gst_schedule_chain_enable_element (GstScheduleChain *chain, GstElement *element)
gst_schedule_cothreaded_chain(GST_BIN(chain->sched->parent),chain);
}
void
static void
gst_schedule_chain_disable_element (GstScheduleChain *chain, GstElement *element)
{
GST_INFO (GST_CAT_SCHEDULING, "disabling element \"%s\" in chain %p", GST_ELEMENT_NAME (element),chain);
......@@ -995,7 +996,7 @@ gst_schedule_chain_disable_element (GstScheduleChain *chain, GstElement *element
// gst_schedule_cothreaded_chain(GST_BIN(chain->sched->parent),chain);
}
void
static void
gst_schedule_chain_remove_element (GstScheduleChain *chain, GstElement *element)
{
GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from chain %p", GST_ELEMENT_NAME (element),chain);
......@@ -1017,7 +1018,7 @@ gst_schedule_chain_remove_element (GstScheduleChain *chain, GstElement *element)
element->sched = NULL;
}
void
static void
gst_schedule_chain_elements (GstSchedule *sched, GstElement *element1, GstElement *element2)
{
GList *chains;
......@@ -1103,7 +1104,7 @@ GST_ELEMENT_SCHED(srcelement),GST_ELEMENT_SCHED(sinkelement));
}
// find the chain within the schedule that holds the element, if any
GstScheduleChain *
static GstScheduleChain *
gst_schedule_find_chain (GstSchedule *sched, GstElement *element)
{
GList *chains;
......@@ -1125,7 +1126,7 @@ gst_schedule_find_chain (GstSchedule *sched, GstElement *element)
return NULL;
}
void
static void
gst_schedule_chain_recursive_add (GstScheduleChain *chain, GstElement *element)
{
GList *pads;
......
......@@ -95,6 +95,7 @@ gst_thread_get_type(void) {
sizeof(GstThread),
4,
(GInstanceInitFunc)gst_thread_init,
NULL
};
thread_type = g_type_register_static(GST_TYPE_BIN, "GstThread", &thread_info, 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment