[MPlayer-dev-eng] [RFC] make stream_read argument void*

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Jul 26 12:26:22 CEST 2007


Hello,
On Thu, Jul 26, 2007 at 12:43:06AM +0200, Nico Sabbi wrote:
> Nico Sabbi wrote:
> > Roberto Togni wrote:
> >>On Wed, 25 Jul 2007 20:38:36 +0200
> >>Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> >>>currently we have quite few casts to avoid compiler complaints.
> >>>IMO the right way is to make stream_read make a void* argument.
> >>>Do you agree that something like this is the right thing to do:
> >>
> >>Ok for me.
> > 
> > me, too
> 
> sorry, I read the patch backwards.
> Now that I read it straight :-) I wonder why can't we fix
> the code that calls stream_read() with any other arguments than char*
> (or even better uint8_t*) instead

Well, because there is code that e.g. reads the extradata after bih? I
don't think it will result in any cleaner code in all cases.
And gcc will still complain about differing sign (though we may have
already silenced that warning).
I also don't see a reason why reading e.g. into a uint16_t array should
raise a warning, using a uint8_t array instead means either using the
much slower AV_R?16 functions or ugly casts somewhere else.
There is one problem though: like this it breaks demux_rtp.cpp because
extern "C" is not enough to get of C++'s we-need-casts-everywhere, so it
must use
char *mem = (char *)dst;
That would be a nice way to really break ffmpeg for all C++ users ;-).

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list