[Vortex] why don't vortex apis use "const gchar*"?

Francis Brosnan Blazquez francis at aspl.es
Tue Nov 14 10:46:52 CET 2006


El lun, 13-11-2006 a las 21:35 -0800, Sam Roberts escribió:

Hi Sam,

> It forces users of the APIs to cast const away. If I was coding
> only against vortex, I could use a const-less style of coding, too,
> but I mix vortex in with code that does declare immutable return
> values,
> casts become necessary.

I agree with you. There is no especial reason to expose Vortex APIs
without "const" declaration (where suitable). 

> Example:
> 
> // lua API:
> const char* lua_tostring(lua_State*L, int idx);
> 
> 
> // Using lua with vortex:
> 
>   const char*  profile = lua_tostring(L, 3);
> 
>   vortex_profiles_register(
>     (gchar*) profile,
>     ...

I see. 

I think the better approach is to identify those functions that would be
suitable to add the "const" declaration and report them (patches are
always welcome).

I've updated the vortex profiles module API to include "const"
declarations where suitable. This is now commited to the vortex SVN.

Cheers!

> Cheers,
> Sam
> 
-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.




More information about the Vortex mailing list