[Mplayer-cvslog] CVS: main/libmpcodecs mp_image.h,1.21,1.22

Filip Kalinski filon at pld.org.pl
Sat Jan 4 08:45:19 CET 2003


On Sat, Jan 04, 2003 at 02:19:03AM +0100, Arpi wrote:
> Hi,
> 
> argh.
> NEVER EVER add #include line sto .h files!
> fix it where it's included.
> 
> commit reversed.
> 

Why???
There is call to malloc, free, memset, and printf here.

What can be fixed is rather moving function bodies to
mp_image.c and leaving only prototypes in mp_image.h.
Then, includes can be added to a .c file.

Now if I include mp_image.h I have to always add includes which I don't
use, this is wrong. This includes have to be in the file, where the
fnctions using them are defined.

...

> > diff -u -r1.21 -r1.22
> > --- mp_image.h	30 Oct 2002 20:50:10 -0000	1.21
> > +++ mp_image.h	4 Jan 2003 01:17:04 -0000	1.22
> > @@ -1,6 +1,13 @@
> >  #ifndef __MP_IMAGE_H
> >  #define __MP_IMAGE_H 1
> >  
> > +#include <stdlib.h>
> > +#include <string.h>
> > +
> > +#ifdef HAVE_MALLOC_H
> > +#include <malloc.h>
> > +#endif
> > +

-- 
Filip Kalinski <filon at pld.org.pl>


More information about the MPlayer-cvslog mailing list