[MPlayer-dev-eng] [PATCH][GUI, too] yet another batch of warning fixes (and some bugfixes, too)

Dominik Mierzejewski dominik at rangers.eu.org
Sat Feb 1 01:20:34 CET 2003


A few missing includes, wrong return types, some typecasts and a possible
10l bug(?) in swscale.c.

Also some trivial fixes for GUI.

-- 
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-20030201/libaf/filter.c.warn	Tue Jan  7 22:35:21 2003
+++ MPlayer-20030201/libaf/filter.c	Sat Feb  1 00:15:42 2003
@@ -11,6 +11,7 @@
 /* Design and implementation of different types of digital filters
 
 */
+#include <string.h>
 #include <math.h>
 #include "dsp.h"
 
--- MPlayer-20030201/libao2/pl_format.c.warn	Fri Aug 23 03:41:12 2002
+++ MPlayer-20030201/libao2/pl_format.c	Sat Feb  1 00:15:42 2003
@@ -228,7 +228,7 @@
       switch(pl_format.in&SIGN_MASK){
       case(US):
 	for(i=0;i<len;i++)
-	((int32_t*)in_data)[i]=(int32_t)(-(1<<31-1)+((uint32_t*)in_data)[i]);
+	((int32_t*)in_data)[i]=(int32_t)(-0xFFFFFFFF+((uint32_t*)in_data)[i]);
 	break;
       case(SI):
 	for(i=0;i<len;i++)
--- MPlayer-20030201/libdha/libdha.c.warn	Fri Jan 24 19:40:48 2003
+++ MPlayer-20030201/libdha/libdha.c	Sat Feb  1 00:15:42 2003
@@ -118,7 +118,7 @@
   if ( (mem_fd = open(DEV_MEM,O_RDWR)) == -1)
   {
     perror("libdha: opening /dev/mem failed");
-    return -1;
+    return MAP_FAILED;
   }
 
 mmap:
@@ -133,7 +133,7 @@
   if (res == -1)
   {
       perror("libdha: unmapping memory failed");
-      return -1;
+      return;
   }
   
   close(mem_fd);
--- MPlayer-20030201/libmpcodecs/ve_qtvideo.c.warn	Fri Jan 24 19:40:48 2003
+++ MPlayer-20030201/libmpcodecs/ve_qtvideo.c	Sat Feb  1 00:15:42 2003
@@ -12,6 +12,10 @@
 #include "../mp_msg.h"
 #include "../bswap.h"
 
+#ifdef USE_WIN32DLL 
+#include "ldt_keeper.h" 
+#endif 
+
 #ifdef USE_QTX_CODECS
 #include "../loader/qtx/qtxsdk/components.h"
 #include "wine/windef.h"
--- MPlayer-20030201/libmpcodecs/dec_audio.h.warn	Sun Oct 13 23:58:54 2002
+++ MPlayer-20030201/libmpcodecs/dec_audio.h	Sat Feb  1 00:15:42 2003
@@ -14,3 +14,6 @@
 	int in_samplerate, int in_channels, int in_format, int in_bps,
 	int out_samplerate, int out_channels, int out_format, int out_bps,
 	int out_minsize, int out_maxsize);
+extern int preinit_audio_filters(sh_audio_t *sh_audio,
+        int in_samplerate, int in_channels, int in_format, int in_bps,
+        int* out_samplerate, int* out_channels, int* out_format, int out_bps);
--- MPlayer-20030201/libvo/geometry.c.warn	Thu Jan 16 13:23:53 2003
+++ MPlayer-20030201/libvo/geometry.c	Sat Feb  1 00:15:42 2003
@@ -1,9 +1,10 @@
 /* This file (C) Mark Zealey <mark at zealos.org> 2002, released under GPL */
 
+#include <stdio.h>
+#include <string.h>
 #include "geometry.h"
 #include "../mp_msg.h"
 #include "../mplayer.h" /* exit_player() */
-#include <string.h>
 
 /* A string of the form [WxH][+X+Y] or xpos[%]:ypos[%] */
 char *vo_geometry = NULL;
--- MPlayer-20030201/libvo/vo_dga.c.warn	Mon Nov 11 16:20:25 2002
+++ MPlayer-20030201/libvo/vo_dga.c	Sat Feb  1 00:15:42 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-20030201/libvo/x11_common.c.warn	Thu Jan 16 13:23:53 2003
+++ MPlayer-20030201/libvo/x11_common.c	Sat Feb  1 00:15:42 2003
@@ -737,7 +737,7 @@
     xev.data.l[0] = layer?ice_layer:orig_layer; // if not fullscreen, stay on default layer
     xev.data.l[1] = CurrentTime;
     mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] );
-    printf( "[x11] Layered style stay on top ( layer %d ).\n",xev.data.l[0] );
+    printf( "[x11] Layered style stay on top ( layer %ld ).\n",xev.data.l[0] );
     XSendEvent(mDisplay, mRootWin, False, SubstructureNotifyMask, (XEvent *) &xev);
     break;
   }
--- MPlayer-20030201/postproc/swscale.c.warn	Sat Feb  1 00:09:41 2003
+++ MPlayer-20030201/postproc/swscale.c	Sat Feb  1 01:10:48 2003
@@ -587,7 +587,7 @@
 			const uint8_t * const d64= dither_8x8_73 [y&7];\
 			const uint8_t * const d128=dither_8x8_220[y&7];\
 			func(uint8_t)\
-				((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\
+				((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]\
 				                 + ((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);\
 			}\
 		}\
@@ -762,7 +762,7 @@
 			const uint8_t * const d64= dither_8x8_73 [y&7];
 			const uint8_t * const d128=dither_8x8_220[y&7];
 			YSCALE_YUV_2_RGBX_C(uint8_t)
-				((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];
+				((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]
 				                  +((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);
 			}
 		}
--- MPlayer-20030201/subreader.c.warn	Sat Feb  1 00:09:23 2003
+++ MPlayer-20030201/subreader.c	Sat Feb  1 00:15:42 2003
@@ -246,7 +246,7 @@
     
     while (!current->text[0]) {
 	if (!fgets (line, LINE_LEN, fd)) return NULL;
-	if ((len=sscanf (line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d",&a1,&a2,&a3,&i,&a4,&b1,&b2,&b3,&i,&b4)) < 10)
+	if ((len=sscanf (line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d",&a1,&a2,&a3,(char *)&i,&a4,&b1,&b2,&b3,(char *)&i,&b4)) < 10)
 	    continue;
 	current->start = a1*360000+a2*6000+a3*100+a4/10;
 	current->end   = b1*360000+b2*6000+b3*100+b4/10;
@@ -864,7 +864,7 @@
 		{sub_uses_time=0;return SUB_MICRODVD;}
 	if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",     &i, &i, &i, &i, &i, &i, &i, &i)==8)
 		{sub_uses_time=1;return SUB_SUBRIP;}
-	if (sscanf (line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d", &i, &i, &i, &i, &i, &i, &i, &i, &i, &i)==10)
+	if (sscanf (line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d", &i, &i, &i, (char *)&i, &i, &i, &i, &i, (char *)&i, &i)==10)
 		{sub_uses_time=1;return SUB_SUBVIEWER;}
 	if (sscanf (line, "{T %d:%d:%d:%d",&i, &i, &i, &i))
 		{sub_uses_time=1;return SUB_SUBVIEWER2;}
--- MPlayer-20030201/mplayer.c.warn	Sat Feb  1 00:09:23 2003
+++ MPlayer-20030201/mplayer.c	Sat Feb  1 00:15:42 2003
@@ -1507,7 +1507,7 @@
 
 current_module="init_video_filters";
 
-sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",video_out);
+sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",(char *)video_out);
 #ifdef HAVE_MENU
 if(use_menu) {
   vf_menu = vf_open_plugin(libmenu_vfs,sh_video->vfilter,"menu",menu_root);
-------------- next part --------------
--- MPlayer-20030124/Gui/mplayer/gtk/fs.c.gui	Fri Jan 24 19:40:43 2003
+++ MPlayer-20030124/Gui/mplayer/gtk/fs.c	Fri Jan 24 22:05:42 2003
@@ -221,6 +221,8 @@
  gtk_widget_show( list );
 }
 
+int fs_PersistantHistory( char *subject ); /* forward declaration */
+
 void ShowFileSelect( int type,int modal )
 {
  int i;
--- MPlayer-20030124/Gui/mplayer/play.c.gui	Sat Jan 18 12:04:56 2003
+++ MPlayer-20030124/Gui/mplayer/play.c	Fri Jan 24 22:05:42 2003
@@ -8,6 +8,7 @@
 #include <signal.h>
 
 #include "../wm/ws.h"
+#include "../wm/wsxdnd.h"
 #include "../../config.h"
 #include "../../help_mp.h"
 #include "../../mplayer.h"
--- MPlayer-20030124/Gui/bitmap.h.gui	Sat Nov  2 18:07:18 2002
+++ MPlayer-20030124/Gui/bitmap.h	Fri Jan 24 22:33:54 2003
@@ -1,11 +1,10 @@
-
 #ifndef __MYSAMPLE
 #define __MYSAMPLE
 
 typedef struct _txSample
 {
- unsigned int  Width;
- unsigned int  Height;
+ unsigned long Width;
+ unsigned long Height;
  unsigned int  BPP;
  unsigned long ImageSize;
  char *        Image;
--- MPlayer-20030124/Gui/app.c.gui	Fri Jan 24 19:40:43 2003
+++ MPlayer-20030124/Gui/app.c	Fri Jan 24 22:05:42 2003
@@ -212,4 +212,3 @@
  for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
    if ( appMPlayer.Items[j].msg == event ) appMPlayer.Items[j].pressed=set;
 }
-												    
\ No newline at end of file


More information about the MPlayer-dev-eng mailing list