[MPlayer-dev-eng] [PATCH] warning fixes for 0_90rc5

Dominik Mierzejewski dominik at rangers.eu.org
Thu Mar 20 13:07:20 CET 2003


Hi,
Here are some trivial warning fixes for review.

In libmpcodecs/vf_down3dright.c gcc complains about undefined operation on
sL and sR. Is this the right fix?

In libmpcodecs/vf_detc.c the status function is missing return type
declaration.

In libmpdemux/demux_xmms.c we have "incompatible" return type.

In libmpdemux/demux_audio.c and libvo/vo_dga.c I fix the "suggest explicit
braces to avoid amgibuous else" warning.

Similar thing in libvo/vo_x11.c, but with && and || operators.

Apart from that, some apparently missing includes and declarations.

-- 
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"
-------------- next part --------------
--- MPlayer-0.90rc5/libmpcodecs/vf_down3dright.c.warn	Mon Mar 10 17:17:02 2003
+++ MPlayer-0.90rc5/libmpcodecs/vf_down3dright.c	Thu Mar 20 11:43:17 2003
@@ -53,10 +53,12 @@
 			unsigned char* sR = fromR;
 
 			if (p->scalew == 1) {
-				for (j = dd; j > 0; j--)
-					*t++ = (*sL++ + *sL++) / 2;
-				for (j = dd ; j > 0; j--)
-					*t++ = (*sR++ + *sR++) / 2;
+				for (j = dd; j > 0; j--) {
+					*t++ = (*sL + *(sL+1)) / 2; sL+=2;
+				}
+				for (j = dd ; j > 0; j--) {
+					*t++ = (*sR + *(sR+1)) / 2; sR+=2;
+				}
 			} else {
 				for (j = dd * 2 ; j > 0; j--)
 					*t++ = *sL++;
--- MPlayer-0.90rc5/libmpcodecs/vf_detc.c.warn	Mon Mar 10 17:17:02 2003
+++ MPlayer-0.90rc5/libmpcodecs/vf_detc.c	Thu Mar 20 11:38:01 2003
@@ -154,7 +154,7 @@
 	*metr = m;
 }
 
-static status(int f, struct metrics *m)
+static void status(int f, struct metrics *m)
 {
 	mp_msg(MSGT_VFILTER, MSGL_V, "frame %d: e=%d o=%d n=%d t=%d\n",
 		f, m->even, m->odd, m->noise, m->temp);
--- MPlayer-0.90rc5/libmpdemux/demux_xmms.c.warn	Sun Feb  2 02:38:29 2003
+++ MPlayer-0.90rc5/libmpdemux/demux_xmms.c	Thu Mar 20 11:11:18 2003
@@ -142,7 +142,7 @@
 static int no_plugins=0;
 
 /* Dummy functions  */
-static int input_get_vis_type(){return 0;}
+static InputVisType input_get_vis_type(){return 0;}
 static void input_add_vis_pcm(int time, AFormat fmt, int nch, int length, void *ptr){}
 static void input_set_info_text(char * text){}
 char *xmms_get_gentitle_format(){ return ""; }
--- MPlayer-0.90rc5/libmpdemux/demux_audio.c.warn	Mon Mar 17 21:42:00 2003
+++ MPlayer-0.90rc5/libmpdemux/demux_audio.c	Thu Mar 20 11:35:09 2003
@@ -175,7 +175,7 @@
     if (l > 0) {
     w->cbSize = stream_read_word_le(s);
     l -= 2;
-    if (w->cbSize > 0)
+    if (w->cbSize > 0) {
       if (l < w->cbSize) {
         mp_msg(MSGT_DEMUX,MSGL_ERR,"[demux_audio] truncated extradata (%d < %d)\n",
 	l,w->cbSize);
@@ -186,6 +186,7 @@
         l -= w->cbSize;
       }
     }
+    }
 
     if(verbose>0) print_wave_header(w);
     if(l)
--- MPlayer-0.90rc5/libmpdvdkit2/libdvdcss.c.warn	Mon Feb 10 21:47:54 2003
+++ MPlayer-0.90rc5/libmpdvdkit2/libdvdcss.c	Thu Mar 20 11:11:18 2003
@@ -117,6 +117,12 @@
 #define SYS_CYGWIN
 #endif
 
+#ifndef HAVE_MPLAYER
+ #include "get_path.c"
+#else
+ extern char * get_path( char * filename );
+#endif
+
 /**
  * \brief Symbol for version checks.
  *
--- MPlayer-0.90rc5/libvo/vo_dga.c.warn	Tue Feb  4 17:14:54 2003
+++ MPlayer-0.90rc5/libvo/vo_dga.c	Thu Mar 20 11:11:18 2003
@@ -555,6 +555,7 @@
        // as long as it's above 50 Hz (acki2 on 30/3/2001)
        ||
        (
+	(
 	(new_x == *old_x) &&
 	(new_y == *old_y) &&
 	(
@@ -568,6 +569,7 @@
 	  new_vbi >= 50
 	 )
 	)
+	)
         ||
         // if everything is equal, then use the mode with the lower 
         // stride 
--- MPlayer-0.90rc5/libvo/vo_x11.c.warn	Tue Feb  4 19:31:44 2003
+++ MPlayer-0.90rc5/libvo/vo_x11.c	Thu Mar 20 11:11:18 2003
@@ -262,7 +262,7 @@
    depth = vo_find_depth_from_visuals(mDisplay, mScreen, &visual);
  }
  if ( !XMatchVisualInfo( mDisplay,mScreen,depth,DirectColor,&vinfo ) ||
-      WinID > 0 && vinfo.visualid != XVisualIDFromVisual(attribs.visual))
+      ( WinID > 0 && vinfo.visualid != XVisualIDFromVisual(attribs.visual)) )
    XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
 
  /* set image size (which is indeed neither the input nor output size), 
--- MPlayer-0.90rc5/libvo/x11_common.c.warn	Mon Feb 10 21:48:59 2003
+++ MPlayer-0.90rc5/libvo/x11_common.c	Thu Mar 20 11:11:18 2003
@@ -254,6 +254,8 @@
  XA_INIT(_BLACKBOX_PID);
 }
 
+int vo_x11_get_fs_type( int supported ); /* forward declaration */
+
 int vo_init( void )
 {
 // int       mScreen;
--- MPlayer-0.90rc5/mplayer.c.warn	Mon Mar 10 15:02:18 2003
+++ MPlayer-0.90rc5/mplayer.c	Thu Mar 20 11:11:18 2003
@@ -44,6 +44,10 @@
 #include "libvo/font_load.h"
 #include "libvo/sub.h"
 
+#ifdef HAVE_X11
+#include "libvo/x11_common.h"
+#endif
+
 #include "libao2/audio_out.h"
 #include "libao2/audio_plugin.h"
 
@@ -96,6 +100,12 @@
 //             Playtree
 //**************************************************************************//
 #include "playtree.h"
+#include "playtreeparser.h"
+
+#ifdef HAVE_NEW_GUI
+extern int import_playtree_playlist_into_gui(play_tree_t* my_playtree, m_config_t* config);
+extern int import_initial_playtree_into_gui(play_tree_t* my_playtree, m_config_t* config, int enqueue);
+#endif
 
 play_tree_t* playtree;
 play_tree_iter_t* playtree_iter = NULL;
--- MPlayer-0.90rc5/playtreeparser.h.warn	Sun Jan 12 20:41:37 2003
+++ MPlayer-0.90rc5/playtreeparser.h	Thu Mar 20 11:11:18 2003
@@ -21,4 +21,7 @@
 play_tree_t*
 play_tree_parser_get_play_tree(play_tree_parser_t* p, int forced);
 
+void
+play_tree_add_bpf(play_tree_t* pt, char* filename);
+
 #endif


More information about the MPlayer-dev-eng mailing list