[FFmpeg-devel] Patch: avoid "void * " in pointer calculate

mvplayer ffmpeg
Thu Feb 14 01:19:34 CET 2008


On Feb 14, 2008 3:00 AM, Reimar D?ffinger <
Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:

> On Wed, Feb 13, 2008 at 01:46:03PM -0500, Rich Felker wrote:
> > On Wed, Feb 13, 2008 at 09:29:46PM +0800, mvplayer wrote:
> > >      /* let's disallow possible ambiguous cases */
> > > @@ -105,9 +106,9 @@
> > >      //FIXME this isn't aligned correctly, though it probably isn't
> needed
> > >      if(!ptr) return av_malloc(size);
> > >      diff= ((char*)ptr)[-1];
> > > -    return realloc(ptr - diff, size + diff) + diff;
> > > +    return (char*)realloc(ptr - diff, size + diff) + diff;
> >
> > This is absolute nonsense. C is not C++.
>
> This is about void*-arithmetic...


No! it is + arithmetic

return (char*)realloc(ptr - diff, size + diff) + diff;
                                                           ^ here


>
>  _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



-- 
----------------------------------------
Inspired by http://www.mvplayer.net




More information about the ffmpeg-devel mailing list