[FFmpeg-devel] [FFmpeg-cvslog] vf_yadif: silence a warning.

Michael Niedermayer michaelni at gmx.at
Thu Feb 14 00:45:34 CET 2013


On Tue, Feb 12, 2013 at 09:30:55PM +0100, James Darnley wrote:
> On 2013-02-06 14:59, Anton Khirnov wrote:
> > ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jan 26 20:49:16 2013 +0100| [99162f8d46db7ec02facae035c4ff573d2d8d612] | committer: Anton Khirnov
> > 
> > vf_yadif: silence a warning.
> > 
> > clang says:
> > libavfilter/vf_yadif.c:192:28: warning: incompatible pointer types assigning to
> > 'void (*)(uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int)'
> > from 'void (uint16_t *, uint16_t *, uint16_t *, uint16_t *, int, int, int, int, int)'
> > 
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99162f8d46db7ec02facae035c4ff573d2d8d612
> > ---
> > 
> >  libavfilter/vf_yadif.c          |   16 ++++++++++++----
> >  libavfilter/x86/vf_yadif_init.c |   12 ++++++------
> >  libavfilter/yadif.h             |    4 ++--
> >  3 files changed, 20 insertions(+), 12 deletions(-)
> > 
> > diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
> > index db9c71c..ae49013 100644
> > --- a/libavfilter/vf_yadif.c
> > +++ b/libavfilter/vf_yadif.c
> > @@ -81,10 +81,14 @@
> >          next2++; \
> >      }
> >  
> > -static void filter_line_c(uint8_t *dst,
> > -                          uint8_t *prev, uint8_t *cur, uint8_t *next,
> > +static void filter_line_c(void *dst1,
> > +                          void *prev1, void *cur1, void *next1,
> >                            int w, int prefs, int mrefs, int parity, int mode)
> >  {
> > +    uint8_t *dst  = dst1;
> > +    uint8_t *prev = prev1;
> > +    uint8_t *cur  = cur1;
> > +    uint8_t *next = next1;
> >      int x;
> >      uint8_t *prev2 = parity ? prev : cur ;
> >      uint8_t *next2 = parity ? cur  : next;
> > @@ -92,11 +96,15 @@ static void filter_line_c(uint8_t *dst,
> >      FILTER
> >  }
> >  
> > -static void filter_line_c_16bit(uint16_t *dst,
> > -                                uint16_t *prev, uint16_t *cur, uint16_t *next,
> > +static void filter_line_c_16bit(void *dst1,
> > +                                void *prev1, void *cur1, void *next1,
> >                                  int w, int prefs, int mrefs, int parity,
> >                                  int mode)
> >  {
> > +    uint16_t *dst  = dst1;
> > +    uint16_t *prev = prev1;
> > +    uint16_t *cur  = cur1;
> > +    uint16_t *next = next1;
> >      int x;
> >      uint16_t *prev2 = parity ? prev : cur ;
> >      uint16_t *next2 = parity ? cur  : next;
> 
> I want to start a discussion about reverting this commit.  Does anyone
> agree with me that this is ugly?  All this change just to silence one

yes its ugly


> warning that I thought an existing void pointer cast was there for.
> This is my only complaint about it.  It does what it says quite well.
> 
> I made a brief comment about it on #ffmpeg-devel last night but I don't
> think anybody was interested.
> 



> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130214/609ee7f8/attachment.asc>


More information about the ffmpeg-devel mailing list