Re: MERGE: bsescm2cxx


On Thu, May 12, 2011 at 06:45:39PM +0200, Tim Janik wrote:
> On Thu, 12 May 2011, Stefan Westerfeld wrote:
> >I've modified the C sources in the bsescm/ directory to be compiled as C++
> >sources, please merge:
> >
> >repo:
> >branch: bsescm2cxx
> Thanks a couple style things that need fixing still:
> * Please use void* instead of gpointer where possible.
> * Please use the following C++ish cast notation:
>   +  gh_new_procedure ("bse-choice-match?", BseScmFunc (bse_scm_choice_match), 2, 0, 0);
> * Please get rid o fthe extra space here:
>   +  SignalData *sdata = (SignalData *) data;
>   Should be:
>   +  SignalData *sdata = (SignalData*) data;

I've fixed these issues in the branch now.

> * For sfi_glue_gc_add(), please investigate if changing
>   the second argument to (void(*free_func)(void*)) is likely to
>   reduce casts. The reason the second funciton pointer argument is
>   just void* is convenience in C, but were're moving away from that
>   so it doesn't make sense to keep convenince C stuff if it makes
>   our C++ life harder.

I can reduce the number of casts in shell/bsescm* by changing the signature,
however there is quite a bit of C code that either will not compile at all or
will compile with warnings if I do this (for instance in sfi/sfiglue.c or the
generated beast-gtk/bstgenapi.c), so overall a lot of new casts need to be
added elsewhere. I'd suggest to delay this change until more of the remaining
code is already C++ified.

   Cu... Stefan
Stefan Westerfeld, Hamburg/Germany,

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