[MPlayer-dev-eng] [PATCH] various warning fixes (and questions)

Arpi arpi at thot.banki.hu
Mon Dec 30 23:27:39 CET 2002


Hi,

this (ONLY this) patch is ok to commit.

> This patch tries to fix the following warnings:
> 
> ve_qtvideo.c: In function `vf_open':
> ve_qtvideo.c:293: warning: implicit declaration of function `Setup_LDT_Keeper'
> ve_qtvideo.c:295: warning: assignment from incompatible pointer type
> [...]
> ve_qtvideo.c:306: warning: assignment from incompatible pointer type
> 
> We need to include ldt_keeper.h and cast the pointers to functions returned by
> GetProcAddress to appropriate function types.
> 
> tv.c: In function `tv_set_channel':
> tv.c:576: warning: no return statement in function returning non-void
> tv.c:576: warning: control reaches end of non-void function
> 
> The return value is never used in mplayer or mencoder, so I'm not sure what
> value should be returned. I inserted return (1), like in other tv_* functions.
> An alternate solution would be to make this function void tv_set_channel.
> 
> cyberblade_vid.c: In function `CROUTW':
> cyberblade_vid.c:69: warning: suggest parentheses around arithmetic in operand of |
> cyberblade_vid.c: In function `SROUTW':
> cyberblade_vid.c:83: warning: suggest parentheses around arithmetic in operand of |
> 
> I hope I got these parentheses right. Anyway the Cyberblade driver seems to
> be broken - I got a report from one user who downloaded my RPMs saying all he's
> got is a pink window. I told him to file a full bugreport to mplayer-users.
> 
> mplayer.c: In function `main':
> mplayer.c:855: warning: too few arguments for format
> 
> This is quite obvious, I think.
> 
> vobsub.c: In function `vobsub_set_from_lang':
> vobsub.c:1164: warning: `return' with no value, in function returning non-void
> 
> And again, I'm not sure what value to return - it's not used anywhere anyway.
> 
> demux_ogg.c: In function `demux_ogg_open':
> demux_ogg.c:472: warning: implicit declaration of function `subcp_open'
> demux_ogg.c: In function `demux_close_ogg':
> demux_ogg.c:1017: warning: implicit declaration of function `subcp_close'
> 
> So it looks like we need either to export these in subreader.h (which is included
> in demux_ogg.c) or declare them as externs in demux_ogg.c. This patch favours the
> former approach.
> 
> -- 
> 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"
> 
> 
> --- MPlayer-20021228/libmpcodecs/ve_qtvideo.c.warn	Fri Dec 27 23:46:21 2002
> +++ MPlayer-20021228/libmpcodecs/ve_qtvideo.c	Sat Dec 28 17:39:33 2002
> @@ -16,6 +16,10 @@
>  #include "../loader/qtx/qtxsdk/components.h"
>  #include "wine/windef.h"
>  
> +#ifdef USE_WIN32DLL
> +#include "ldt_keeper.h"
> +#endif
> +
>  #include "codec-cfg.h"
>  #include "stream.h"
>  #include "demuxer.h"
> @@ -292,18 +296,18 @@
>  
>      Setup_LDT_Keeper();
>      handler = LoadLibraryA("qtmlClient.dll");
> -    InitializeQTML = GetProcAddress(handler, "InitializeQTML");
> -    GetGWorldPixMap = GetProcAddress(handler, "GetGWorldPixMap");
> -    QTNewGWorldFromPtr = GetProcAddress(handler, "QTNewGWorldFromPtr");
> -    NewHandleClear = GetProcAddress(handler, "NewHandleClear");
> -    FindCodec = GetProcAddress(handler,"FindCodec");
> -    CompressSequenceBegin = GetProcAddress(handler,"CompressSequenceBegin");
> -    CompressSequenceFrame = GetProcAddress(handler,"CompressSequenceFrame");
> -    GetMaxCompressionSize = GetProcAddress(handler,"GetMaxCompressionSize");
> -    CDSequenceEnd = GetProcAddress(handler,"CDSequenceEnd");
> -    FindNextComponent = GetProcAddress(handler, "FindNextComponent");
> -    CountComponents = GetProcAddress(handler, "CountComponents");
> -    GetComponentInfo = GetProcAddress(handler, "GetComponentInfo");
> +    InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
> +    GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
> +    QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
> +    NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
> +    FindCodec = (OSErr (*)(CodecType,CodecComponent,CompressorComponent *,DecompressorComponent *))GetProcAddress(handler,"FindCodec");
> +    CompressSequenceBegin = (OSErr(*)(ImageSequence *,PixMapHandle,PixMapHandle,const Rect *,const Rect *,short,CodecType,CompressorComponent,CodecQ,CodecQ,long,CTabHandle,CodecFlags,ImageDescriptionHandle))GetProcAddress(handler,"CompressSequenceBegin");
> +    CompressSequenceFrame = (OSErr(*)(ImageSequence,PixMapHandle,const Rect *,CodecFlags,Ptr,long *,UInt8 *,ICMCompletionProcRecordPtr))GetProcAddress(handler,"CompressSequenceFrame");
> +    GetMaxCompressionSize = (OSErr(*)(PixMapHandle,const Rect *,short,CodecQ,CodecType,CompressorComponent,long *))GetProcAddress(handler,"GetMaxCompressionSize");
> +    CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler,"CDSequenceEnd");
> +    FindNextComponent = (Component (*)(Component,ComponentDescription*))GetProcAddress(handler, "FindNextComponent");
> +    CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents");
> +    GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo");
>      if(!InitializeQTML  ||!CompressSequenceBegin){
>          printf("invalid qt DLL!\n");
>          return 0;
> --- MPlayer-20021228/libmpdemux/tv.c.warn	Sun Dec 22 23:44:16 2002
> +++ MPlayer-20021228/libmpdemux/tv.c	Sat Dec 28 17:39:33 2002
> @@ -573,6 +573,7 @@
>  		break;
>  	    }
>  	}
> +	return(1);
>  }
>  
>  int tv_step_norm(tvi_handle_t *tvh)
> --- MPlayer-20021228/vidix/drivers/cyberblade_regs.h.warn	Sat Dec 21 14:06:23 2002
> +++ MPlayer-20021228/vidix/drivers/cyberblade_regs.h	Sat Dec 28 17:39:33 2002
> @@ -135,12 +135,12 @@
>  #define OUTW(addr,val) (*(unsigned short *)(cyberblade_reg_base+addr)=(val))
>  
>  #define SRINB(reg) (OUTB(0x3c4,reg), INB(0x3c5))
> -#define SROUTB(reg,val) (OUTW(0x3c4,(val)<<8|reg))
> +#define SROUTB(reg,val) (OUTW(0x3c4,((val)<<8)|(reg)))
>  
>  #define CRINB(reg) \
>  	(OUTB(cyberblade_crtc+4,reg), INB(cyberblade_crtc+5))
>  
>  #define CROUTB(reg,val) \
> -	(OUTW(cyberblade_crtc+4,(val)<<8|reg))
> +	(OUTW(cyberblade_crtc+4,((val)<<8)|(reg)))
>  
>  /* --- */
> --- MPlayer-20021228/mplayer.c.warn	Sat Dec 28 17:25:27 2002
> +++ MPlayer-20021228/mplayer.c	Sat Dec 28 17:39:33 2002
> @@ -852,7 +852,7 @@
>         next_edl_record->next = NULL;
>       } else {
>         if( ( edl_fd = fopen( edl_output_filename, "w" ) ) == NULL ) {
> -	 printf( "Error opening file [%s] for writing!\n" );
> +	 printf( "Error opening file [%s] for writing!\n", edl_output_filename );
>  	 edl_output_filename = NULL;
>  	 next_edl_record->next = NULL;
>         }
> --- MPlayer-20021228/vobsub.c.warn	Thu Dec 26 23:46:16 2002
> +++ MPlayer-20021228/vobsub.c	Sat Dec 28 17:39:33 2002
> @@ -1161,7 +1161,7 @@
>            if ((strncmp(vob->spu_streams[i].id, lang, 2)==0)){
>  	    vobsub_id=i;
>  	    mp_msg(MSGT_VOBSUB, MSGL_INFO, "Selected VOBSUB language: %d language: %s\n", i, vob->spu_streams[i].id);
> -	    return;
> +	    return 0;
>  	  }
>        lang+=2;while (lang[0]==',' || lang[0]==' ') ++lang;
>      }
> --- MPlayer-20021228/subreader.h.warn	Sat Dec 28 18:07:28 2002
> +++ MPlayer-20021228/subreader.h	Sat Dec 28 18:07:15 2002
> @@ -39,6 +39,8 @@
>  
>  subtitle* sub_read_file (char *filename, float pts);
>  subtitle* subcp_recode1 (subtitle *sub);
> +void subcp_open (void); /* for demux_ogg.c */
> +void subcp_close (void); /* for demux_ogg.c */
>  char * sub_filename(char *path, char * fname);
>  void list_sub_file(subtitle* subs);
>  void dump_srt(subtitle* subs, float fps);
> 
> 


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list