From f0e16a09f76390732215d5f8086c216af6a6715e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 1 Mar 2010 23:54:40 +0000 Subject: [PATCH] try (unsuccessfully) to fix gcc complaints about function-pointer/object-pointer mixing (its much deeper than this change suggests) git-svn-id: svn://localhost/ardour2/branches/3.0@6715 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/canvas-waveview.c | 12 ++++-------- gtk2_ardour/canvas-waveview.h | 13 +++++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index f3a3117622..c1383f087b 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -763,26 +763,22 @@ gnome_canvas_waveview_set_property (GObject *object, break; case PROP_LENGTH_FUNCTION: - waveview->length_function = (gulong (*)(void*)) g_value_get_pointer(value); + waveview->length_function = (waveview_length_function_t) g_value_get_pointer(value); redraw = TRUE; break; case PROP_SOURCEFILE_LENGTH_FUNCTION: - waveview->sourcefile_length_function = (gulong (*)(void*,double)) g_value_get_pointer(value); + waveview->sourcefile_length_function = (waveview_sourcefile_length_function_t) g_value_get_pointer(value); redraw = TRUE; break; case PROP_PEAK_FUNCTION: - waveview->peak_function = - (void (*)(void*,gulong,gulong,gulong,gpointer,guint32,double)) - g_value_get_pointer(value); + waveview->peak_function = (waveview_peak_function_t) g_value_get_pointer(value); redraw = TRUE; break; case PROP_GAIN_FUNCTION: - waveview->gain_curve_function = - (void (*)(void *arg, double start, double end, float* vector, gint64 veclen)) - g_value_get_pointer(value); + waveview->gain_curve_function = (waveview_gain_curve_function_t) g_value_get_pointer(value); redraw = TRUE; break; diff --git a/gtk2_ardour/canvas-waveview.h b/gtk2_ardour/canvas-waveview.h index 89c193a440..f04a4b38c2 100644 --- a/gtk2_ardour/canvas-waveview.h +++ b/gtk2_ardour/canvas-waveview.h @@ -64,6 +64,11 @@ struct _GnomeCanvasWaveViewCache GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new (); void gnome_canvas_waveview_cache_destroy (GnomeCanvasWaveViewCache*); +typedef gulong (*waveview_length_function_t)(void*); +typedef gulong (*waveview_sourcefile_length_function_t)(void*, double); +typedef void (*waveview_gain_curve_function_t)(void *arg, double start, double end, float* vector, gint64 veclen); +typedef void (*waveview_peak_function_t)(void*,gulong,gulong,gulong,gpointer,guint32,double); + struct _GnomeCanvasWaveView { GnomeCanvasItem item; @@ -74,10 +79,10 @@ struct _GnomeCanvasWaveView void *data_src; guint32 channel; - void (*peak_function)(void*,gulong,gulong,gulong,gpointer,guint32,double); - gulong (*length_function)(void *); - gulong (*sourcefile_length_function)(void*,double); - void (*gain_curve_function)(void *arg, double start, double end, float* vector, gint64 veclen); + waveview_peak_function_t peak_function; + waveview_length_function_t length_function; + waveview_sourcefile_length_function_t sourcefile_length_function; + waveview_gain_curve_function_t gain_curve_function; void *gain_src; /** x-axis: samples per canvas unit. */