[MPlayer-cvslog] CVS: main/libmpcodecs vf.h, 1.24, 1.25 vf.c, 1.108, 1.109 vd.c, 1.79, 1.80

Ivan Kalvachev ivan at cacad.com
Wed Dec 1 15:04:59 CET 2004


On Wed,  1 Dec 2004 10:30:14 +0100 (CET)
syncmail at mplayerhq.hu (Jindrich Makovicka CVS) wrote:

> CVS change done by Jindrich Makovicka CVS
> 
> Update of /cvsroot/mplayer/main/libmpcodecs
> In directory mail:/var2/tmp/cvs-serv22883
> 
> Modified Files:
> 	vf.h vf.c vd.c 
> Log Message:
> fix image dimensions at filter config time
> 
> Index: vf.h
> ===================================================================
>  
> +#ifdef MP_DEBUG
> +#include <assert.h>
> +#endif
> +
[...]
> +#ifdef MP_DEBUG
> +  assert(w == -1 || w >= vf->w);
> +  assert(h == -1 || h >= vf->h);
> +  assert(vf->w > 0);
> +  assert(vf->h > 0);
> +#endif

I was going to flame somebody about this suboptimal usage of asserts, and
it accidentally happened to be be you.
Read the man assert, and next time write something like:

#ifndef MP_DEBUG
#define NDEBUG 1
#endif

[...]

assert(vf->w > 0);
assert(w > vf->w);

[soon]

No need to #ifdef around assert() as defining NDEBUG will cause assert to generate no code!

About the rest of the code... Later.

Wish You Best
   Ivan Kalvachev
  iive




More information about the MPlayer-cvslog mailing list