[vlc-devel] [PATCH v6 4/5] video_filter-sharpen: assert that SHARPEN_FRAME macro's maxval parameter is positive

Filip Roséen filip at atch.se
Wed Apr 12 10:28:56 CEST 2017


Hi Hugo,

On 2017-04-12 10:14, Hugo Beauzée-Luyssen wrote:

> On Tue, Apr 11, 2017, at 11:39 PM, victorien.lecouviour.tuffet at gmail.com
> wrote:
> >      \
> > +        assert((maxval) >= 0);                                         
> > \
> >          data_t *restrict p_src = (data_t *)p_pic->p[Y_PLANE].p_pixels; 
> >          \
> >          data_t *restrict p_out = (data_t
> >          *)p_outpic->p[Y_PLANE].p_pixels; \
> >          const unsigned data_sz = sizeof(data_t);                       
> >          \
> 
> static_assert seems like a better choice here

The current usage only involves *constant-expressions*, but the macro
itself does not restrict itself to such (as `maxval` of course doesn't
have to be a *constant-expression* for things to work as they should).

For what it's worth; I vote keeping the `assert`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170412/a404025b/attachment.html>


More information about the vlc-devel mailing list