From 42ebe8b588c593d388f632dd95d66d3c15011730 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 1 Jun 2001 18:24:41 +0000 Subject: [PATCH] Fixed a couple of compiler warnings. Original commit message from CVS: Fixed a couple of compiler warnings. --- tests/Makefile.am | 2 +- tests/autoplug.c | 15 +++++++-------- tests/capsconnect.c | 1 - tests/incsched.c | 6 ++++-- tests/load.c | 3 ++- tests/loadall.c | 2 ++ tests/mp1vid.c | 3 ++- tests/mp3encode.c | 10 ++++++---- tests/nego/nego1.c | 10 +++++----- tests/paranoia.c | 3 +-- tests/reaping.c | 12 +++++++----- tests/registry.c | 4 +++- tests/sched/runxml.c | 2 +- tests/threadlock.c | 10 +++++----- 14 files changed, 46 insertions(+), 37 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 14f6776..72b4fe6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = sched eos nego noinst_PROGRAMS = init loadall simplefake states caps queue registry \ paranoia rip mp3encode autoplug props case4 markup load tee autoplug2 autoplug3 \ -capsconnect padfactory autoplug4 incsched reaping threadlock mp1vid +capsconnect padfactory autoplug4 incsched reaping threadlock mp1vid # we have nothing but apps here, we can do this safely LIBS += $(GST_LIBS) diff --git a/tests/autoplug.c b/tests/autoplug.c index 2898e64..ec9c943 100644 --- a/tests/autoplug.c +++ b/tests/autoplug.c @@ -12,7 +12,7 @@ main (int argc, char *argv[]) GstElement *element; GstElement *videosink, *osssink; GstAutoplug *autoplugger; - GList *testcaps; + GstCaps *testcaps; gst_init(&argc,&argv); @@ -21,13 +21,12 @@ main (int argc, char *argv[]) videosink = gst_elementfactory_make ("videosink", "videosink"); g_assert (videosink != NULL); - testcaps = g_list_append (NULL, - gst_caps_new ("test_caps", - "video/mpeg", - gst_props_new ( - "mpegversion", GST_PROPS_INT (1), - "systemstream", GST_PROPS_BOOLEAN (TRUE), - NULL))); + testcaps = gst_caps_new ("test_caps", + "video/mpeg", + gst_props_new ( + "mpegversion", GST_PROPS_INT (1), + "systemstream", GST_PROPS_BOOLEAN (TRUE), + NULL)); autoplugger = gst_autoplugfactory_make ("static"); diff --git a/tests/capsconnect.c b/tests/capsconnect.c index 01e8e7b..6201a7c 100644 --- a/tests/capsconnect.c +++ b/tests/capsconnect.c @@ -2,7 +2,6 @@ int main(int argc,char *argv[]) { - gboolean testret; xmlDocPtr doc; xmlNodePtr parent; GstElement *mpg123; diff --git a/tests/incsched.c b/tests/incsched.c index f73b617..9f150e7 100644 --- a/tests/incsched.c +++ b/tests/incsched.c @@ -10,8 +10,8 @@ int main(int argc,char *argv[]) { gst_debug_set_categories(-1); g_print("\n\nConstructing stuff:\n"); - thread = gst_pipeline_new("thread"); - bin = gst_bin_new("bin"); + thread = GST_BIN (gst_pipeline_new("thread")); + bin = GST_BIN (gst_bin_new("bin")); src = gst_elementfactory_make("fakesrc","src"); identity = gst_elementfactory_make("identity","identity"); sink = gst_elementfactory_make("fakesink","sink"); @@ -132,4 +132,6 @@ int main(int argc,char *argv[]) { g_print("\n\nIterating:\n"); gst_bin_iterate(thread); + + return 0; } diff --git a/tests/load.c b/tests/load.c index 7b932f7..481c38d 100644 --- a/tests/load.c +++ b/tests/load.c @@ -2,9 +2,10 @@ int main(int argc,char *argv[]) { GstElement *element; - int i; gst_init(&argc,&argv); element = gst_elementfactory_make(argv[1],"element"); + + return 0; } diff --git a/tests/loadall.c b/tests/loadall.c index c663bf9..f51b505 100644 --- a/tests/loadall.c +++ b/tests/loadall.c @@ -3,4 +3,6 @@ int main(int argc,char *argv[]) { gst_init(&argc,&argv); gst_plugin_load_all(); + + return 0; } diff --git a/tests/mp1vid.c b/tests/mp1vid.c index 2ad61b4..8353110 100644 --- a/tests/mp1vid.c +++ b/tests/mp1vid.c @@ -1,3 +1,4 @@ +#include #include GstElement *audiothread; @@ -38,7 +39,7 @@ void new_pad(GstElement *parse,GstPad *pad,GstElement *pipeline) { int main(int argc,char *argv[]) { GstElement *pipeline, *sourcethread, *src, *parse; - int i; + //int i; gst_init(&argc,&argv); diff --git a/tests/mp3encode.c b/tests/mp3encode.c index e8b3d98..f5bc74d 100644 --- a/tests/mp3encode.c +++ b/tests/mp3encode.c @@ -8,7 +8,7 @@ int main(int argc,char *argv[]) { GstPipeline *pipeline; GstElement *src,*lame,*sink; - int bitrate; + int bitrate = 128000; int fdin = -1; int fdout = -1; int i; @@ -22,8 +22,8 @@ int main(int argc,char *argv[]) { switch (argv[i][1]) { case 'b': bitrate = atoi(argv[++i]);break; case 0: { - if (fdin == -1) fdin = stdin; - else if (fdout == -1) fdout = stdout; + if (fdin == -1) fdin = STDIN_FILENO; + else if (fdout == -1) fdout = STDOUT_FILENO; else fprintf(stderr,"unknown argument\n");exit(1); break; } @@ -52,7 +52,7 @@ int main(int argc,char *argv[]) { } } - pipeline = gst_pipeline_new("mp3encode"); + pipeline = GST_PIPELINE (gst_pipeline_new("mp3encode")); src = gst_elementfactory_make("fdsrc","src"); g_return_val_if_fail(src != NULL,1); @@ -81,4 +81,6 @@ int main(int argc,char *argv[]) { fprintf(stderr,"\n"); gst_bin_iterate(GST_BIN(pipeline)); } + + return 0; } diff --git a/tests/nego/nego1.c b/tests/nego/nego1.c index f396471..462cb03 100644 --- a/tests/nego/nego1.c +++ b/tests/nego/nego1.c @@ -3,15 +3,15 @@ /* this is an example of the src pad dictating the caps * the sink pad only accepts audio/raw */ -static GstCaps* -negotiate (GstPad *pad, GstCaps *caps, gint count) +static GstPadNegotiateReturn +negotiate (GstPad *pad, GstCaps **caps, gpointer *count) { g_print ("negotiation entered\n"); - if (!strcmp (gst_caps_get_mime (caps), "audio/raw")) - return caps; + if (!strcmp (gst_caps_get_mime (*caps), "audio/raw")) + return GST_PAD_NEGOTIATE_AGREE; - return NULL; + return GST_PAD_NEGOTIATE_FAIL; } int diff --git a/tests/paranoia.c b/tests/paranoia.c index 94f86c9..0325e79 100644 --- a/tests/paranoia.c +++ b/tests/paranoia.c @@ -8,8 +8,7 @@ void paranoia_eos(GstPad *pad) { int main(int argc,char *argv[]) { GstPipeline *pipeline; GstElement *paranoia,*queue,*audio_thread,*osssink; - int i; - int track = (argc == 2) ? atoi(argv[1]) : 1; + //int track = (argc == 2) ? atoi(argv[1]) : 1; GST_DEBUG_ENTER("(%d)",argc); diff --git a/tests/reaping.c b/tests/reaping.c index 3714e54..c322efb 100644 --- a/tests/reaping.c +++ b/tests/reaping.c @@ -9,8 +9,8 @@ int main(int argc,char *argv[]) { gst_info_set_categories(-1); gst_debug_set_categories(-1); - pipeline = gst_pipeline_new("pipeline"); - thread = gst_thread_new("thread"); + pipeline = GST_BIN (gst_pipeline_new("pipeline")); + thread = GST_BIN (gst_thread_new("thread")); src = gst_elementfactory_make("fakesrc","src"); queue1 = gst_elementfactory_make("queue","queue"); sink = gst_elementfactory_make("fakesink","sink"); @@ -23,13 +23,15 @@ int main(int argc,char *argv[]) { gst_element_add_ghost_pad(GST_ELEMENT(thread),gst_element_get_pad(sink,"sink"),"sink"); gst_element_connect (src,"src",queue1,"sink"); - gst_element_connect (queue1, "src", thread, "sink"); + gst_element_connect (queue1, "src", GST_ELEMENT (thread), "sink"); fprintf(stderr,"\n\n\n"); - gst_element_set_state (pipeline, GST_STATE_READY); + gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY); fprintf(stderr,"\n\n\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); + gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL); + + return 0; } diff --git a/tests/registry.c b/tests/registry.c index 804df82..a7ac4c5 100644 --- a/tests/registry.c +++ b/tests/registry.c @@ -95,7 +95,7 @@ static void print_some_providers (gchar *mime) { guint16 type; - GList *srcs, *sinks; + //GList *srcs, *sinks; type = gst_type_find_by_mime (mime); /* @@ -147,4 +147,6 @@ int main(int argc,char *argv[]) dump_factory ("lame"); dump_factory ("mpeg_play"); + + return 0; } diff --git a/tests/sched/runxml.c b/tests/sched/runxml.c index eb42490..044b51d 100644 --- a/tests/sched/runxml.c +++ b/tests/sched/runxml.c @@ -42,7 +42,7 @@ int main(int argc,char *argv[]) g_print ("\n *** using testfile %s\n", argv[1]); xml = gst_xml_new(); - xml = gst_xml_parse_file (xml, argv[1], NULL); + gst_xml_parse_file (xml, argv[1], NULL); toplevelelements = gst_xml_get_topelements (xml); diff --git a/tests/threadlock.c b/tests/threadlock.c index 7003726..52b3807 100644 --- a/tests/threadlock.c +++ b/tests/threadlock.c @@ -3,14 +3,14 @@ int main(int argc,char *argv[]) { GstBin *pipeline, *thread; - GstElement *src, *queue1, *sink; + GstElement *src, *sink; gst_info_set_categories(-1); gst_debug_set_categories(-1); gst_init(&argc,&argv); - pipeline = gst_pipeline_new("pipeline"); - thread = gst_thread_new("thread"); + pipeline = GST_BIN (gst_pipeline_new("pipeline")); + thread = GST_BIN (gst_thread_new("thread")); src = gst_elementfactory_make("fakesrc","src"); gtk_object_set(GTK_OBJECT(src),"silent",TRUE,NULL); sink = gst_elementfactory_make("fakesink","sink"); @@ -28,10 +28,10 @@ int main(int argc,char *argv[]) { while (1) { fprintf(stderr,"\nSWITCHING to PLAYING:\n"); - gst_element_set_state (thread, GST_STATE_PLAYING); + gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PLAYING); sleep(1); fprintf(stderr,"\nSWITCHING to PAUSED:\n"); - gst_element_set_state (thread, GST_STATE_PAUSED); + gst_element_set_state (GST_ELEMENT (thread), GST_STATE_PAUSED); // sleep(1); } } -- 2.7.4