fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Change the char* in the API to const char*


From: josh
Subject: Re: [fluid-dev] Change the char* in the API to const char*
Date: Wed, 28 Oct 2009 12:55:21 -0700
User-agent: Internet Messaging Program (IMP) H3 (4.1.6)

Hello Louis,

Quoting "Louis B." <address@hidden>:
Hi all,

I have a change that I would like to see i the next release if possible.

Change all the char* references to const char* in the public API.

The fluid_synth_sfload API already has this change. But it is missing
from for example the fluid_settings_setint API. When compiling
MidiDeviceFluidSynth.cpp I get the following error message.

MidiDeviceFluidSynth.cpp:95: warning: deprecated conversion from
string constant to ‘char*’

http://pianobooster.svn.sourceforge.net/viewvc/pianobooster/trunk/PianoBooster/src/MidiDeviceFluidSynth.cpp?revision=73&view=markup

and if I remove the type cast from line 249 of
MidiDeviceFluidSynth.cpp it generates an error

MidiDeviceFluidSynth.cpp:249: error: invalid conversion from ‘const
char*’ to ‘char*’

Thanks

Louis


I went through the entire FluidSynth API and changed relevant char * parameters to const char *.

Of note is that I also changed a few callback prototypes. This will result in warnings in existing applications which utilize any of the following function callbacks: fluid_log_function_t, fluid_settings_foreach_option_t, fluid_settings_foreach_t and fluid_server_newclient_func_t.

This seemed to me like a good idea, for consistency and to get rid of warnings in the FluidSynth source code when calling those callback functions. This may in fact not be such a good idea though. Anyone got any opinions on this?

During the process of going over a lot of the API, I realized that there were still some undocumented functions. I had assumed that Doxygen would report missing docs, but it appears this is just for "missing members" and not functions. Unfortunate, since it is pretty time consuming and error prone manually checking for missing docs. I think at this point though all public API stuff is documented.

Best regards,
Josh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]