[MPlayer-dev-eng] [PATCH] configurable BINDIR and MANDIR; silencing compiler warnings, continued

Dominik Mierzejewski dominik at rangers.eu.org
Sun Sep 1 16:12:25 CEST 2002


On Sunday, 01 September 2002, Arpi wrote:
> Hi,
> 
> > Second, I managed to silence most compiler warnings for now (patch
> > attached). Note that this reverses my last patch to
> > libmpcodecs/vd_ffmpeg.c, because it was wrong. This patch changes the
> > definition of draw_slice to be consistent in all places and makes
> > appropriate changes wherever it's used. Small fix to
> nice (and 10l to me :()

Don't worry, I screwed up, because I filtered out some warnings and tried
to deal with the "easy" ones first.

[...]
> > is a fix of dvdcss_open definitions (makes them consistent everywhere).
> hmm
> are you sur ethese fixes are the good fixes (especially the
> off_t* -> off_t) ? then i'll submit them to livdvdcss devel team.

I'm sure about off_t* -> off_t, because it's an integer type, not pointer
type. And I'm fairly sure about the function definition, too.
 
> > Now this one:
> > mplayer.c:1261: warning: assignment makes pointer from integer without a cast
> > mplayer.c:1262: warning: assignment makes pointer from integer without a cast
> > is very interesting, because the same code
> > mplayer.c:
> > [...]
> > sh_video->vfilter=vf_open_filter(NULL,"vo",video_out);
> > sh_video->vfilter=append_filters(sh_video->vfilter);
> > [...]
> > compiles without warning in all other places
> 
> this warning pops up when you have missing/bad declaration for
> vf_open_filter() so the compiler things it returns int, but you want to
> store the return value in void* (sh_video->vfilter).
> 
> include "vf.h" should help here

But of course it does. :-)

> > The following one
> > open.c:494: warning: assignment discards qualifiers from pointer target
> > type
> i've never seen such warning msg

Nevertheless, it's there.

> > libmpdemux/open.c:
> > [...]
> > int dvd_parse_chapter_range(struct config *conf, const char *range){
> >   char *s, *t;
> >   conf; /* prevent warning from GCC */
> >   s = range;
> >   dvd_chapter = 1;
> > [...]
> > I think should be fixed by making a copy of range instead of assigning
> > the pointer.
> hmm
> or remove 'const' ?

I don't like the idea of modifying the function parameters unless it's
necessary (that's why it's good practice to make them const, isn't it?).
Here, it isn't required, so I suggest something like:

--- MPlayer-20020901/libmpdemux/open.c.warn     Sat Aug 10 18:57:12 2002 
+++ MPlayer-20020901/libmpdemux/open.c  Sun Sep  1 16:03:37 2002 
@@ -491,7 +491,7 @@
 int dvd_parse_chapter_range(struct config *conf, const char *range){
   char *s, *t;
   conf; /* prevent warning from GCC */
-  s = range; 
+  strcpy(s,range); 
   dvd_chapter = 1;
   dvd_last_chapter = 0;
   if (*range && isdigit(*range)) {

 
> > This one:
> > vo_xv.c:484: warning: assignment makes pointer from integer without a
> > cast
> > is curious, too, because:
> > libvo/vo_xv.c:
> > [...]
> > static XvImage* xvimage[NUM_BUFFERS];
> > [...]
> >    xvimage[foo] = XvShmCreateImage(mDisplay, xv_port, xv_format, 0,
> > image_width, image_height, &Shmi
> > [...]
> > XvShmCreateImage does return (XvImage*). I checked it three times.
> 
> but is the needed .h file (containing XvShmCreateImage() decl) included
> there?

Yup. Line 77 of vo_xv.c:
#include <X11/extensions/Xvlib.h> 

Defined there are both XvImage and XvShmCreateImage().

> > loader/win32.c:
> 
> leave the loader stuff now, mayeb mail them to Kabi, if he agree i'll
> commit

OK, will do.

PS. I've just did cvs update and guess what, there are more warnings
waiting to be fixed. :-)
 
-- 
MPlayer RPMs maintainer: http://www.piorunek.pl/~dominik/linux/pkgs/mplayer/
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"



More information about the MPlayer-dev-eng mailing list