From 859cff2af6d9aed5e266c03c156eb52b991e24b4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Jan 2014 17:32:24 +0000 Subject: Fix missing function prototype warnings. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@5274 a436a847-0d15-0410-975c-d299462d15a1 --- src/wdatutil.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/wdatutil.c b/src/wdatutil.c index a6f5bd3..a549c26 100644 --- a/src/wdatutil.c +++ b/src/wdatutil.c @@ -1,6 +1,6 @@ /* Code to generate wavedata for bandlimited waveforms. - Copyright 2011 David Robillard + Copyright 2011-2014 David Robillard Copyright 2003 Mike Rawes This is free software: you can redistribute it and/or modify it @@ -241,6 +241,17 @@ wavedata_generate_tables(Wavedata* w, } } +static void +wavedata_write_prototype(FILE* wdat_fp, + const char* data_name) +{ + fprintf(wdat_fp, "int\n"); + fprintf( + wdat_fp, + "blop_get_%s (Wavedata * w, double sample_rate, const char* bundle_path, const LV2_Feature* const* features)", + data_name); +} + int wavedata_write(Wavedata* w, FILE* wdat_fp, @@ -261,6 +272,11 @@ wavedata_write(Wavedata* w, fprintf(wdat_fp, "#include \n"); fprintf(wdat_fp, "#include \"wavedata.h\"\n"); fprintf(wdat_fp, "\n"); + /* + * Function prototype + */ + wavedata_write_prototype(wdat_fp, data_name); + fprintf(wdat_fp, ";\n\n"); /* * Fixed data and tables */ @@ -324,12 +340,8 @@ wavedata_write(Wavedata* w, * Function to get Wavedata - the sample rate is needed to calculate * frequencies and related things */ - fprintf(wdat_fp, "int\n"); - fprintf( - wdat_fp, - "blop_get_%s (Wavedata * w, double sample_rate, const char* bundle_path, const LV2_Feature* const* features)\n", - data_name); - fprintf(wdat_fp, "{\n"); + wavedata_write_prototype(wdat_fp, data_name); + fprintf(wdat_fp, "\n{\n"); fprintf(wdat_fp, "\tWavetable * t;\n"); fprintf(wdat_fp, "\tunsigned long ti;\n"); fprintf(wdat_fp, "\n"); @@ -408,7 +420,7 @@ wavedata_write(Wavedata* w, * _init() * Assemble tables and lookup */ - fprintf(wdat_fp, "void\n"); + fprintf(wdat_fp, "static void\n"); fprintf(wdat_fp, "__attribute__ ((constructor))\n"); fprintf(wdat_fp, "init (void)\n"); fprintf(wdat_fp, "{\n"); -- cgit v1.2.1