13
0

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
This commit is contained in:
Paul Davis 2010-03-01 23:54:40 +00:00
parent 482f21f9dd
commit f0e16a09f7
2 changed files with 13 additions and 12 deletions

View File

@ -763,26 +763,22 @@ gnome_canvas_waveview_set_property (GObject *object,
break; break;
case PROP_LENGTH_FUNCTION: 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; redraw = TRUE;
break; break;
case PROP_SOURCEFILE_LENGTH_FUNCTION: 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; redraw = TRUE;
break; break;
case PROP_PEAK_FUNCTION: case PROP_PEAK_FUNCTION:
waveview->peak_function = waveview->peak_function = (waveview_peak_function_t) g_value_get_pointer(value);
(void (*)(void*,gulong,gulong,gulong,gpointer,guint32,double))
g_value_get_pointer(value);
redraw = TRUE; redraw = TRUE;
break; break;
case PROP_GAIN_FUNCTION: case PROP_GAIN_FUNCTION:
waveview->gain_curve_function = waveview->gain_curve_function = (waveview_gain_curve_function_t) g_value_get_pointer(value);
(void (*)(void *arg, double start, double end, float* vector, gint64 veclen))
g_value_get_pointer(value);
redraw = TRUE; redraw = TRUE;
break; break;

View File

@ -64,6 +64,11 @@ struct _GnomeCanvasWaveViewCache
GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new (); GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new ();
void gnome_canvas_waveview_cache_destroy (GnomeCanvasWaveViewCache*); 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 struct _GnomeCanvasWaveView
{ {
GnomeCanvasItem item; GnomeCanvasItem item;
@ -74,10 +79,10 @@ struct _GnomeCanvasWaveView
void *data_src; void *data_src;
guint32 channel; guint32 channel;
void (*peak_function)(void*,gulong,gulong,gulong,gpointer,guint32,double); waveview_peak_function_t peak_function;
gulong (*length_function)(void *); waveview_length_function_t length_function;
gulong (*sourcefile_length_function)(void*,double); waveview_sourcefile_length_function_t sourcefile_length_function;
void (*gain_curve_function)(void *arg, double start, double end, float* vector, gint64 veclen); waveview_gain_curve_function_t gain_curve_function;
void *gain_src; void *gain_src;
/** x-axis: samples per canvas unit. */ /** x-axis: samples per canvas unit. */