[MPlayer-cvslog] r31611 - trunk/libmpcodecs/vd_xanim.c

reimar subversion at mplayerhq.hu
Thu Jul 1 23:11:10 CEST 2010


Author: reimar
Date: Thu Jul  1 23:11:10 2010
New Revision: 31611

Log:
Give functions proper prototypes.

Modified:
   trunk/libmpcodecs/vd_xanim.c

Modified: trunk/libmpcodecs/vd_xanim.c
==============================================================================
--- trunk/libmpcodecs/vd_xanim.c	Thu Jul  1 22:57:40 2010	(r31610)
+++ trunk/libmpcodecs/vd_xanim.c	Thu Jul  1 23:11:10 2010	(r31611)
@@ -70,12 +70,19 @@ LIBVD_EXTERN(xanim)
 #endif
 #endif
 
+struct XA_CODEC_HDR;
+struct XA_DEC_INFO;
+
+typedef long init_function(struct XA_CODEC_HDR *);
+typedef unsigned int decode_function(unsigned char *, unsigned char *,
+                                      unsigned int, struct XA_DEC_INFO *);
+
 typedef struct
 {
   unsigned int		what;
   unsigned int		id;
-  int			(*iq_func)();	/* init/query function */
-  unsigned int		(*dec_func)();  /* opt decode function */
+  init_function        *iq_func;    /* init/query function */
+  decode_function      *dec_func;   /* opt decode function */
 } XAVID_FUNC_HDR;
 
 #define XAVID_WHAT_NO_MORE	0x0000
@@ -98,7 +105,7 @@ typedef struct
 } XAVID_MOD_HDR;
 
 /* XA CODEC .. */
-typedef struct
+typedef struct XA_CODEC_HDR
 {
   void			*anim_hdr;
   unsigned int		compression;
@@ -106,10 +113,10 @@ typedef struct
   unsigned int		depth;
   void			*extra;
   unsigned int		xapi_rev;
-  unsigned int		(*decoder)();
+  decode_function	*decoder;
   char			*description;
   unsigned int		avi_ctab_flag;
-  unsigned int		(*avi_read_ext)();
+  unsigned int		(*avi_read_ext)(void);
 } XA_CODEC_HDR;
 
 #define CODEC_SUPPORTED 1
@@ -149,7 +156,7 @@ typedef struct XA_CHDR_STRUCT
   struct XA_CHDR_STRUCT	*new_chdr;
 } XA_CHDR;
 
-typedef struct
+typedef struct XA_DEC_INFO
 {
   unsigned int		cmd;
   unsigned int		skip_flag;
@@ -177,9 +184,8 @@ typedef struct
 typedef struct {
     XA_DEC_INFO *decinfo;
     void *file_handler;
-    long (*iq_func)(XA_CODEC_HDR *codec_hdr);
-    unsigned int (*dec_func)(unsigned char *image, unsigned char *delta,
-	unsigned int dsize, XA_DEC_INFO *dec_info);
+    init_function *iq_func;
+    decode_function *dec_func;
     mp_image_t *mpi;
 } vd_xanim_ctx;
 
@@ -212,7 +218,7 @@ void *xa_close_func[XA_CLOSE_FUNCS];
 static int xacodec_load(sh_video_t *sh, char *filename)
 {
     vd_xanim_ctx *priv = sh->context;
-    void *(*what_the)();
+    void *(*what_the)(void);
     char *error;
     XAVID_MOD_HDR *mod_hdr;
     XAVID_FUNC_HDR *func;
@@ -282,19 +288,19 @@ static int xacodec_load(sh_video_t *sh, 
 	{
 	    mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: avi init/query func (id: %d)\n",
 		func[i].iq_func, func[i].id);
-	    priv->iq_func = (void *)func[i].iq_func;
+	    priv->iq_func = func[i].iq_func;
 	}
 	if (func[i].what & XAVID_QT_QUERY)
 	{
 	    mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: qt init/query func (id: %d)\n",
 		func[i].iq_func, func[i].id);
-	    priv->iq_func = (void *)func[i].iq_func;
+	    priv->iq_func = func[i].iq_func;
 	}
 	if (func[i].what & XAVID_DEC_FUNC)
 	{
 	    mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: decoder func (init/query: %p) (id: %d)\n",
 		func[i].dec_func, func[i].iq_func, func[i].id);
-	    priv->dec_func = (void *)func[i].dec_func;
+	    priv->dec_func = func[i].dec_func;
 	}
     }
     return 1;
@@ -319,7 +325,7 @@ static int xacodec_query(sh_video_t *sh,
     switch(ret)
     {
 	case CODEC_SUPPORTED:
-	    priv->dec_func = (void *)codec_hdr->decoder;
+	    priv->dec_func = codec_hdr->decoder;
 	    mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Codec is supported: found decoder for %s at %p\n",
 		codec_hdr->description, codec_hdr->decoder);
 	    return 1;
@@ -339,7 +345,7 @@ static int xacodec_query(sh_video_t *sh,
  * Add forward declarations to avoid warnings with -Wmissing-prototypes. */
 void XA_Print(char *fmt, ...);
 void TheEnd1(char *err_mess);
-void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)());
+void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)(void));
 unsigned long XA_Time_Read(void);
 void XA_Gen_YUV_Tabs(XA_ANIM_HDR *anim_hdr);
 void JPG_Setup_Samp_Limit_Table(XA_ANIM_HDR *anim_hdr);
@@ -375,7 +381,7 @@ void TheEnd1(char *err_mess)
     return;
 }
 
-void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)())
+void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)(void))
 {
 //    XA_Print("XA_Add_Func_To_Free_Chain('anim_hdr: %08x', 'function: %08x')",
 //	    anim_hdr, function);
@@ -756,7 +762,7 @@ static void uninit(sh_video_t *sh)
 {
     vd_xanim_ctx *priv = sh->context;
     int i;
-    void (*close_func)();
+    void (*close_func)(void);
 
     for (i=0; i < XA_CLOSE_FUNCS; i++)
 	if (xa_close_func[i])


More information about the MPlayer-cvslog mailing list