Change GST_DEBUG_FUNCPTR() to return a pointer of the same type that it is called with. Fix lots of warnings due to ...

Original commit message from CVS:
Change GST_DEBUG_FUNCPTR() to return a pointer of the same type that it
is called with.  Fix lots of warnings due to change.
This commit is contained in:
David Schleef 2003-05-18 23:34:12 +00:00
parent 7e88251c0f
commit 214c557a6d
5 changed files with 21 additions and 18 deletions

View file

@ -465,7 +465,7 @@ extern GstErrorHandler _gst_error_handler;
void* _gst_debug_register_funcptr (void *ptr, gchar *ptrname); void* _gst_debug_register_funcptr (void *ptr, gchar *ptrname);
gchar* _gst_debug_nameof_funcptr (void *ptr); 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) #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
#else #else
#define GST_DEBUG_FUNCPTR(ptr) (ptr) #define GST_DEBUG_FUNCPTR(ptr) (ptr)

View file

@ -114,11 +114,11 @@ static void do_cothread_switch(cothread *to)
#define do_cothread_create(new_cothread, context, func, argc, argv) \ #define do_cothread_create(new_cothread, context, func, argc, argv) \
G_STMT_START{ \ G_STMT_START{ \
new_cothread = cothread_create ((func), 0, (void**) (argv), (context)); \ new_cothread = cothread_create ((func), 0, (char**) (argv), (context)); \
}G_STMT_END }G_STMT_END
#define do_cothread_setfunc(cothread, context, func, argc, argv) \ #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) #define do_cothread_destroy(cothread) cothread_destroy(cothread)

View file

@ -124,7 +124,7 @@ static void gst_basic_scheduler_pad_link (GstScheduler *sched, GstPad *src
GstPad *sinkpad); GstPad *sinkpad);
static void gst_basic_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, static void gst_basic_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad,
GstPad *sinkpad); 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, static GstClockReturn gst_basic_scheduler_clock_wait (GstScheduler *sched, GstElement *element,
GstClockID id, GstClockTimeDiff *jitter); GstClockID id, GstClockTimeDiff *jitter);
static GstSchedulerState static GstSchedulerState
@ -265,8 +265,8 @@ GstPluginDesc plugin_desc = {
plugin_init plugin_init
}; };
static void static int
gst_basic_scheduler_loopfunc_wrapper (int argc, void **argv) gst_basic_scheduler_loopfunc_wrapper (int argc, char **argv)
{ {
GstElement *element = GST_ELEMENT_CAST (argv); GstElement *element = GST_ELEMENT_CAST (argv);
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
@ -294,10 +294,12 @@ gst_basic_scheduler_loopfunc_wrapper (int argc, void **argv)
GST_DEBUG_LEAVE ("(%d,'%s')", argc, name); GST_DEBUG_LEAVE ("(%d,'%s')", argc, name);
gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element));
return 0;
} }
static void static int
gst_basic_scheduler_chain_wrapper (int argc, void **argv) gst_basic_scheduler_chain_wrapper (int argc, char **argv)
{ {
GstElement *element = GST_ELEMENT_CAST (argv); GstElement *element = GST_ELEMENT_CAST (argv);
G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element); G_GNUC_UNUSED const gchar *name = GST_ELEMENT_NAME (element);
@ -356,10 +358,12 @@ gst_basic_scheduler_chain_wrapper (int argc, void **argv)
GST_DEBUG_LEAVE ("(%d,'%s')", argc, name); GST_DEBUG_LEAVE ("(%d,'%s')", argc, name);
gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element));
return 0;
} }
static void static int
gst_basic_scheduler_src_wrapper (int argc, void **argv) gst_basic_scheduler_src_wrapper (int argc, char **argv)
{ {
GstElement *element = GST_ELEMENT_CAST (argv); GstElement *element = GST_ELEMENT_CAST (argv);
GList *pads; GList *pads;
@ -381,7 +385,7 @@ gst_basic_scheduler_src_wrapper (int argc, void **argv)
pads = g_list_next (pads); pads = g_list_next (pads);
if (GST_RPAD_DIRECTION (realpad) == GST_PAD_SRC && GST_PAD_IS_USABLE (realpad)) { 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)); 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)); buf = GST_RPAD_GETFUNC (realpad) (GST_PAD_CAST (realpad));
if (buf) { if (buf) {
GST_DEBUG (GST_CAT_DATAFLOW, "calling gst_pad_push on pad %s:%s %p", GST_DEBUG (GST_CAT_DATAFLOW, "calling gst_pad_push on pad %s:%s %p",
@ -401,6 +405,8 @@ gst_basic_scheduler_src_wrapper (int argc, void **argv)
SCHED (element)->current = NULL; SCHED (element)->current = NULL;
GST_DEBUG_LEAVE (""); GST_DEBUG_LEAVE ("");
return 0;
} }
static void static void
@ -1296,7 +1302,7 @@ gst_basic_scheduler_pad_unlink (GstScheduler * sched, GstPad * srcpad, GstPad *
#endif #endif
} }
static GstPad * static void
gst_basic_scheduler_pad_select (GstScheduler * sched, GList * padlist) gst_basic_scheduler_pad_select (GstScheduler * sched, GList * padlist)
{ {
GstPad *pad = NULL; GstPad *pad = NULL;
@ -1329,7 +1335,6 @@ gst_basic_scheduler_pad_select (GstScheduler * sched, GList * padlist)
g_assert (pad != NULL); g_assert (pad != NULL);
} }
return pad;
} }
static GstClockReturn static GstClockReturn

View file

@ -224,7 +224,7 @@ static gboolean gst_opt_scheduler_interrupt (GstScheduler *sched, GstElement
static void gst_opt_scheduler_error (GstScheduler *sched, GstElement *element); 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_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
static void gst_opt_scheduler_pad_unlink (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, static GstClockReturn gst_opt_scheduler_clock_wait (GstScheduler *sched, GstElement *element,
GstClockID id, GstClockTimeDiff *jitter); GstClockID id, GstClockTimeDiff *jitter);
static GstSchedulerState static GstSchedulerState
@ -1782,14 +1782,12 @@ gst_opt_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkp
} }
} }
static GstPad* static void
gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist) gst_opt_scheduler_pad_select (GstScheduler *sched, GList *padlist)
{ {
//GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched); //GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
g_warning ("pad select, implement me"); g_warning ("pad select, implement me");
return NULL;
} }
static GstClockReturn static GstClockReturn

View file

@ -35,7 +35,7 @@
*/ */
/* define "cothread", "cothread_context" and "cothread_func" */ /* 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 cothread;
typedef struct _cothread_context cothread_context; typedef struct _cothread_context cothread_context;