[MPlayer-dev-eng] [PATCH] de-templatize TV new_handle function
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Mon Sep 13 19:49:15 CEST 2010
On Mon, Sep 13, 2010 at 06:50:53PM +0200, Diego Biurrun wrote:
> On Mon, Sep 13, 2010 at 06:36:11PM +0200, Reimar Döffinger wrote:
> > On Mon, Sep 13, 2010 at 04:58:36PM +0200, Diego Biurrun wrote:
> > > On Sun, Sep 12, 2010 at 04:06:04PM +0200, Reimar Döffinger wrote:
> > > > On Sun, Sep 12, 2010 at 01:52:03PM +0200, Diego Biurrun wrote:
> > > > > +tvi_handle_t *tv_new_handle(const size_t size,
> > > >
> > > > What's that const supposed to be good for?
> > >
> > > The function parameter is not changed so I figured it would not hurt..
> >
> > It also doesn't have any advantage, and it does hurt in so far that
> > it makes changing the function more annoying (e.g. if you wanted to enforce
> > a minimum "size" you'd either have to add another variable or remove that
> > const).
>
> New patch without const.
Feel free to just commit whatever you want, but I do have a few "advisory" comments.
> +tvi_handle_t *tv_new_handle(size_t size, const tvi_functions_t *functions)
Just using "int" instead of size_t really shouldn't cause any
issues and avoids those two extra includes.
> + tvi_handle_t *h = malloc(sizeof(tvi_handle_t));
sizeof(*h) is probably preferable in principle.
More information about the MPlayer-dev-eng
mailing list