From: David S. <dsc...@us...> - 2003-05-18 23:34:25
|
CVS Root: /cvsroot/gstreamer Modules: cothreads gstreamer Changes by: dschleef Date: Sun May 18 2003 16:34:25 PDT Log message: Change GST_DEBUG_FUNCPTR() to return a pointer of the same type that it is called with. Fix lots of warnings due to change. Modified files: cothreads/cothreads: cothreads.c cothreads.h gstreamer/gst : gstinfo.h gstreamer/gst/schedulers: cothreads_compat.h gstbasicscheduler.c gstoptimalscheduler.c gthread-cothreads.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/cothreads/cothreads/cothreads.c.diff?r1=1.23&r2=1.24 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/cothreads/cothreads/cothreads.h.diff?r1=1.11&r2=1.12 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstinfo.h.diff?r1=1.44&r2=1.45 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/cothreads_compat.h.diff?r1=1.11&r2=1.12 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/gstbasicscheduler.c.diff?r1=1.73&r2=1.74 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/gstoptimalscheduler.c.diff?r1=1.45&r2=1.46 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/gthread-cothreads.h.diff?r1=1.6&r2=1.7 ====Begin Diffs==== Index: gstinfo.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/gstinfo.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- gstinfo.h 13 May 2003 06:48:49 -0000 1.44 +++ gstinfo.h 18 May 2003 23:34:11 -0000 1.45 @@ -465,7 +465,7 @@ void* _gst_debug_register_funcptr (void *ptr, gchar *ptrname); gchar* _gst_debug_nameof_funcptr (void *ptr); -#define GST_DEBUG_FUNCPTR(ptr) _gst_debug_register_funcptr((void *)(ptr), #ptr) +#define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr) #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr) #else #define GST_DEBUG_FUNCPTR(ptr) (ptr) Index: cothreads_compat.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/schedulers/cothreads_compat.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- cothreads_compat.h 11 Mar 2003 21:01:28 -0000 1.11 +++ cothreads_compat.h 18 May 2003 23:34:12 -0000 1.12 @@ -114,11 +114,11 @@ #define do_cothread_create(new_cothread, context, func, argc, argv) \ G_STMT_START{ \ - new_cothread = cothread_create ((func), 0, (void**) (argv), (context)); \ + new_cothread = cothread_create ((func), 0, (char**) (argv), (context)); \ }G_STMT_END #define do_cothread_setfunc(cothread, context, func, argc, argv) \ - cothread_setfunc ((cothread), (func), (argc), (void **) (argv), (context)) + cothread_setfunc ((cothread), (func), (argc), (char **) (argv), (context)) #define do_cothread_destroy(cothread) cothread_destroy(cothread) Index: gstbasicscheduler.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/schedulers/gstbasicscheduler.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- gstbasicscheduler.c 10 Feb 2003 07:53:58 -0000 1.73 +++ gstbasicscheduler.c 18 May 2003 23:34:12 -0000 1.74 @@ -124,7 +124,7 @@ GstPad *sinkpad); static void gst_basic_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); -static GstPad* gst_basic_scheduler_pad_select (GstScheduler *sched, GList *padlist); +static void gst_basic_scheduler_pad_select (GstScheduler *sched, GList *padlist); static GstClockReturn gst_basic_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); static GstSchedulerState @@ -265,8 +265,8 @@ plugin_init }; -static void -gst_basic_scheduler_loopfunc_wrapper (int argc, void **argv) +static int +gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv) { GstElement *element = GST_ELEMENT_CAST (argv); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); @@ -294,10 +294,12 @@ GST_DEBUG_LEAVE ("(%d,'%s')", argc, name); gst_object_unref (GST_OBJECT (element)); + + return 0; } -static void -gst_basic_scheduler_chain_wrapper (int argc, void **argv) +static int +gst_basic_scheduler_chain_wrapper (int argc, char **argv) { GstElement *element = GST_ELEMENT_CAST (argv); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); @@ -356,10 +358,12 @@ GST_DEBUG_LEAVE ("(%d,'%s')", argc, name); gst_object_unref (GST_OBJECT (element)); + + return 0; } -static void -gst_basic_scheduler_src_wrapper (int argc, void **argv) +static int +gst_basic_scheduler_src_wrapper (int argc, char **argv) { GstElement *element = GST_ELEMENT_CAST (argv); GList *pads; @@ -381,7 +385,7 @@ pads = g_list_next (pads); if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SRC && GST_PAD_IS_USABLE (realpad)) { GST_DEBUG (GST_CAT_DATAFLOW, "calling _getfunc for %s:%s", GST_DEBUG_PAD_NAME (realpad)); - g_return_if_fail (GST_RPAD_GETFUNC (realpad) != NULL); + g_return_val_if_fail (GST_RPAD_GETFUNC (realpad) != NULL, 0); buf = GST_RPAD_GETFUNC (realpad) (GST_PAD_CAST (realpad)); if (buf) { GST_DEBUG (GST_CAT_DATAFLOW, "calling gst_pad_push on pad %s:%s %p", @@ -401,6 +405,8 @@ SCHED (element)->current = NULL; GST_DEBUG_LEAVE (""); + + return 0; } static void @@ -1296,7 +1302,7 @@ #endif } -static GstPad * +static void gst_basic_scheduler_pad_select (GstScheduler * sched, GList * padlist) { GstPad *pad = NULL; @@ -1329,7 +1335,6 @@ g_assert (pad != NULL); } - return pad; } static GstClockReturn Index: gstoptimalscheduler.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/schedulers/gstoptimalscheduler.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- gstoptimalscheduler.c 28 Mar 2003 17:29:57 -0000 1.45 +++ gstoptimalscheduler.c 18 May 2003 23:34:12 -0000 1.46 @@ -224,7 +224,7 @@ static void gst_opt_scheduler_error (GstScheduler *sched, GstElement *element); static void gst_opt_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); static void gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); -static GstPad* gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist); +static void gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist); static GstClockReturn gst_opt_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); static GstSchedulerState @@ -1782,14 +1782,12 @@ } } -static GstPad* +static void gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist) { //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); g_warning ("pad select, implement me"); - - return NULL; } static GstClockReturn Index: gthread-cothreads.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/schedulers/gthread-cothreads.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- gthread-cothreads.h 18 May 2003 15:03:34 -0000 1.6 +++ gthread-cothreads.h 18 May 2003 23:34:12 -0000 1.7 @@ -35,7 +35,7 @@ */ /* define "cothread", "cothread_context" and "cothread_func" */ -typedef void (*cothread_func) (int, char **); +typedef int (*cothread_func) (int, char **); typedef struct _cothread cothread; typedef struct _cothread_context cothread_context; Index: cothreads.c =================================================================== RCS file: /cvsroot/gstreamer/cothreads/cothreads/cothreads.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- cothreads.c 1 Feb 2003 20:29:23 -0000 1.23 +++ cothreads.c 18 May 2003 23:34:12 -0000 1.24 @@ -52,8 +52,8 @@ struct _cothread_private { cothread self; int argc; - void **argv; - void (*func) (int argc, void **argv); + char **argv; + cothread_func func; cothread_chunk *chunk; cothread *main; }; @@ -237,7 +237,7 @@ * Returns: A pointer to the new cothread */ cothread* -cothread_create (cothread_func func, int argc, void **argv, cothread *main) +cothread_create (cothread_func func, int argc, char **argv, cothread *main) { char *low, *high, *dest; cothread_private priv; @@ -322,7 +322,7 @@ * Reset a cothread to start running @func, as if it were newly created. */ void -cothread_reset (cothread *self, cothread_func func, int argc, void **argv, cothread *main) +cothread_reset (cothread *self, cothread_func func, int argc, char **argv, cothread *main) { char *low, *high; cothread_chunk *chunk = ((cothread_private*)self)->chunk; @@ -346,7 +346,7 @@ * Like cothread_reset, but doesn't reset the machine context. */ void -cothread_setfunc (cothread *self, cothread_func func, int argc, void **argv, cothread *main) +cothread_setfunc (cothread *self, cothread_func func, int argc, char **argv, cothread *main) { cothread_private *priv; Index: cothreads.h =================================================================== RCS file: /cvsroot/gstreamer/cothreads/cothreads/cothreads.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- cothreads.h 21 Jun 2002 04:33:33 -0000 1.11 +++ cothreads.h 18 May 2003 23:34:12 -0000 1.12 @@ -28,17 +28,17 @@ typedef cothreads_mctx_t cothread; -typedef void (*cothread_func) (int, void**); +typedef int (*cothread_func) (int, char **); gboolean cothreads_initialized (void); gboolean cothreads_init (glong stack_size, gint ncothreads); gboolean cothreads_init_thread (glong stack_size, gint ncothreads); -cothread* cothread_create (cothread_func func, int argc, void **argv, cothread *main); +cothread* cothread_create (cothread_func func, int argc, char **argv, cothread *main); cothread* cothread_self (void); -void cothread_reset (cothread *self, cothread_func func, int argc, void **argv, cothread *main); -void cothread_setfunc (cothread *self, cothread_func func, int argc, void **argv, cothread *main); +void cothread_reset (cothread *self, cothread_func func, int argc, char **argv, cothread *main); +void cothread_setfunc (cothread *self, cothread_func func, int argc, char **argv, cothread *main); void cothread_destroy (cothread *thread); gboolean cothreads_alloc_thread_stack (void **stack, glong *stacksize); |