[MPlayer-dev-eng] [PATCH] another batch of compilation warnings fixes (GUI too)

Dominik Mierzejewski dominik at rangers.eu.org
Thu Oct 10 01:38:00 CEST 2002


As promised, some other warnings that may need fixing:
mplayer/gtk/eq.c:71: warning: implicit declaration of function `get_video_colors'
I can't #include "../../../libmpcodecs/dec_video.h", because it requires
#include'ing "../../../libmpdemux/stheader.h", which tries to #include
"wine/avifmt.h" and fails, and so the whole thing fails to compile.

mga_common.c:400: warning: initialization discards qualifiers from pointer target type
libvo/mga_common.c:
[...]
static uint32_t preinit(const char *vo_subdevice)
{
  char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid";
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        f = open(devname,O_RDWR);
        if(f == -1)
        {
                perror("open");
                printf("vo_mga: Couldn't open %s\n",devname);
                return(-1);
        }
        
#ifdef VO_XMGA 
  if (!vo_init()) return -1;
#endif 

  return 0;
}
[...]
Classic const char -> char assignment problem. We could I suppose do
something like
char devname[255]=strdup((vo_subdevice!=NULL)?vo_subdevice:"/dev/mga_vid");
But I don't want to hardcode the size, so I'm asking for your opinion.

Oh, and I've attached some patches to fix other warnings and one thing I
thought could be done better:
Gui/mplayer/gtk/fs.c:
-   if ( ( name[i] >='a' )&&( name[i] <= 'z' ) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
+   if ( isalpha(name[i]) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }

It does basically the same thing, but in a cleaner way (IMHO). It's
independent of others, so you may apply it at your own discretion.

-- 
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-20021009/Gui/mplayer/gtk/fs.c.gui	Wed Oct  2 00:22:33 2002
+++ MPlayer-20021009/Gui/mplayer/gtk/fs.c	Thu Oct 10 00:19:48 2002
@@ -5,6 +5,7 @@
 #include <sys/stat.h>
 #include <glob.h>
 #include <unistd.h>
+#include <ctype.h>
 
 #include "../mplayer.h"
 
@@ -129,7 +130,7 @@
  int  i,c;
  for ( i=0,c=0;i < strlen( name );i++ )
   {
-   if ( ( name[i] >='a' )&&( name[i] <= 'z' ) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
+   if ( isalpha(name[i]) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
     else tmp[c++]=name[i];
   }
  tmp[c]=0;
@@ -539,7 +540,7 @@
  GtkWidget     * hseparator2;
  GtkWidget     * hseparator3;
  GtkWidget     * hbuttonbox3;
- int             i;
+/* int             i;*/
 
  GtkWidget     * uppixmapwid;
  GdkPixmap     * uppixmap;
--- MPlayer-20021009/Gui/wm/ws.c.gui	Wed Oct  2 00:22:34 2002
+++ MPlayer-20021009/Gui/wm/ws.c	Thu Oct 10 00:19:48 2002
@@ -94,7 +94,7 @@
 typedef void(*wsTConvFunc)( const unsigned char * in_pixels, unsigned char * out_pixels, unsigned num_pixels );
 wsTConvFunc wsConvFunc = NULL;
 																															
-void rgb32torgb32( const unsigned char * src, unsigned char * dst,int src_size )
+void rgb32torgb32( const unsigned char * src, unsigned char * dst,unsigned int src_size )
 { memcpy( dst,src,src_size ); }
 
 // ---
@@ -776,7 +776,7 @@
  Atom            type;
  int             format;
  unsigned long   nitems, bytesafter;
- Atom          * args = NULL;
+ unsigned char   * args = NULL;
 
  if ( wsWMType == wsWMIceWM )
   {
--- MPlayer-20021009/Gui/interface.h.gui	Fri Oct  4 00:13:36 2002
+++ MPlayer-20021009/Gui/interface.h	Thu Oct 10 00:19:48 2002
@@ -139,6 +139,7 @@
 extern int  guiGetEvent( int type,char * arg );
 extern void guiEventHandling( void );
 extern void guiLoadFont( void );
+extern void guiLoadSubtitle( char * name );
 
 typedef struct _plItem 
 {
--- MPlayer-20021009/Gui/cfg.c.gui	Fri Oct  4 00:13:36 2002
+++ MPlayer-20021009/Gui/cfg.c	Thu Oct 10 00:19:48 2002
@@ -221,7 +221,7 @@
 	    }
        case CONF_TYPE_STRING_LIST:
             {
-	     char ** tmp = *( (char **)gui_opts[i].p );
+	     char ** tmp = (char **)gui_opts[i].p;
 	     if ( tmp && tmp[0] && tmp[0][0] ) fprintf( f,"%s = \"%s\"\n",gui_opts[i].name,tmp[0] );
 	     break;
 	    }
-------------- next part --------------
--- MPlayer-20021009/libmpcodecs/dec_video.h.warn	Wed Oct  2 00:22:36 2002
+++ MPlayer-20021009/libmpcodecs/dec_video.h	Wed Oct  9 23:55:33 2002
@@ -15,7 +15,7 @@
 extern int get_video_quality_max(sh_video_t *sh_video);
 extern void set_video_quality(sh_video_t *sh_video,int quality);
 
-int get_video_colors(sh_video_t *sh_video,char *item,int *value);
+extern int get_video_colors(sh_video_t *sh_video,char *item,int *value);
 extern int set_video_colors(sh_video_t *sh_video,char *item,int value);
 extern int set_rectangle(sh_video_t *sh_video,int param,int value);
 
--- MPlayer-20021009/libmpcodecs/dec_audio.h.warn	Wed Oct  9 21:40:14 2002
+++ MPlayer-20021009/libmpcodecs/dec_audio.h	Wed Oct  9 23:55:33 2002
@@ -13,4 +13,4 @@
 extern int init_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,
-	int out_minsize, int out_maxsize);
\ No newline at end of file
+	int out_minsize, int out_maxsize);
--- MPlayer-20021009/libvo/x11_common.c.warn	Wed Oct  9 21:40:18 2002
+++ MPlayer-20021009/libvo/x11_common.c	Wed Oct  9 23:55:33 2002
@@ -635,7 +635,7 @@
  Atom            type;
  int             format;
  unsigned long   nitems, bytesafter;
- Atom          * args = NULL;
+ unsigned char   * args = NULL;
 
  if ( WinID >= 0 ) return;
  
--- MPlayer-20021009/mplayer.c.warn	Wed Oct  9 21:39:38 2002
+++ MPlayer-20021009/mplayer.c	Wed Oct  9 23:59:31 2002
@@ -1274,7 +1274,7 @@
   //const ao_info_t *info=audio_out->info;
   current_module="ao2_init";
   if(!(audio_out=init_best_audio_out(audio_driver_list,
-      (ao_plugin_cfg.plugin_list), // plugin flag
+      (ao_plugin_cfg.plugin_list!=NULL), // plugin flag
       force_srate?force_srate:sh_audio->samplerate*playback_speed,
       audio_output_channels?audio_output_channels:
       sh_audio->channels,audio_output_format?audio_output_format:


More information about the MPlayer-dev-eng mailing list