[MPlayer-dev-eng] [PATCH] fix numerous const issues in libmpcodecs

Rich Felker dalias at aerifal.cx
Fri Oct 19 06:38:46 CEST 2007


On Fri, Oct 19, 2007 at 01:40:44AM +0300, Ivan Kalvachev wrote:
> 2007/10/18, Rich Felker <dalias at aerifal.cx>:
> > MPlayer has LOTS of issues with constant data tables which are not
> > declared const. While this might or might not have impact on its
> > memory usage (probably small if any), it's very unclean and makes it
> > hard to use tools like 'size' to identify modules which are
> > incorrectly using real global variables instead of per-context data.
> >
> > The attached patch is the initial work towards fixing the problem in
> > libmpcodecs. I'm submitting it now for comments before I go to lots
> > more work, only to have someone bitch about why it's bad.. :) So
> > please comment now. And if anyone would like to volunteer to finish
> > the job so I don't have to, I'd be quite happy with that too. :))
> 
> Is there situation when vf_info_t would be variable and not constant?
> (dynamic plug-ins?)

Dynamic plugins are not supported and probably never will be (nor
would they use non-const info), but the issue is irrelevant.
Const-qualified pointers can always point to non-constant data. It's
only the other way around that could be problematic.

> If not, you can define the type as const and make the patch much smaller.

Oh... I don't think it's even possible, but if it is, it's extremely
bad style...

Rich



More information about the MPlayer-dev-eng mailing list