[MPlayer-cvslog] r30164 - in trunk: libao2/ao_alsa.c libao2/ao_dart.c libvo/vo_gl.c libvo/vo_gl2.c libvo/vo_ivtv.c libvo/vo_jpeg.c libvo/vo_png.c libvo/vo_pnm.c libvo/vo_v4l2.c libvo/vo_xv.c libvo/vo_xvmc.c libvo/v...

reimar subversion at mplayerhq.hu
Fri Jan 1 14:18:49 CET 2010


Author: reimar
Date: Fri Jan  1 14:18:49 2010
New Revision: 30164

Log:
Fix function declarations to avoid casting function pointers.

Modified:
   trunk/libao2/ao_alsa.c
   trunk/libao2/ao_dart.c
   trunk/libvo/vo_gl.c
   trunk/libvo/vo_gl2.c
   trunk/libvo/vo_ivtv.c
   trunk/libvo/vo_jpeg.c
   trunk/libvo/vo_png.c
   trunk/libvo/vo_pnm.c
   trunk/libvo/vo_v4l2.c
   trunk/libvo/vo_xv.c
   trunk/libvo/vo_xvmc.c
   trunk/libvo/vo_zr2.c
   trunk/subopt-helper.c
   trunk/subopt-helper.h

Modified: trunk/libao2/ao_alsa.c
==============================================================================
--- trunk/libao2/ao_alsa.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libao2/ao_alsa.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -263,7 +263,8 @@ static void print_help (void)
            MSGTR_AO_ALSA_CommandlineHelp);
 }
 
-static int str_maxlen(strarg_t *str) {
+static int str_maxlen(void *strp) {
+  strarg_t *str = strp;
   if (str->len > ALSA_DEVICE_SIZE)
     return 0;
   return 1;
@@ -328,7 +329,7 @@ static int init(int rate_hz, int channel
     snd_pcm_uframes_t boundary;
     const opt_t subopts[] = {
       {"block", OPT_ARG_BOOL, &block, NULL},
-      {"device", OPT_ARG_STR, &device, (opt_test_f)str_maxlen},
+      {"device", OPT_ARG_STR, &device, str_maxlen},
       {NULL}
     };
 

Modified: trunk/libao2/ao_dart.c
==============================================================================
--- trunk/libao2/ao_dart.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libao2/ao_dart.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -148,7 +148,7 @@ static int init(int rate, int channels, 
 
     const opt_t subopts[] = {
         {"share", OPT_ARG_BOOL, &fShare, NULL},
-        {"bufsize", OPT_ARG_INT, &nDartSamples, (opt_test_f)int_non_neg},
+        {"bufsize", OPT_ARG_INT, &nDartSamples, int_non_neg},
         {NULL}
     };
 

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_gl.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -1012,12 +1012,12 @@ static const opt_t subopts[] = {
   {"scaled-osd",   OPT_ARG_BOOL, &scaled_osd,   NULL},
   {"aspect",       OPT_ARG_BOOL, &use_aspect,   NULL},
   {"ycbcr",        OPT_ARG_BOOL, &use_ycbcr,    NULL},
-  {"slice-height", OPT_ARG_INT,  &slice_height, (opt_test_f)int_non_neg},
-  {"rectangle",    OPT_ARG_INT,  &use_rectangle,(opt_test_f)int_non_neg},
-  {"yuv",          OPT_ARG_INT,  &use_yuv,      (opt_test_f)int_non_neg},
+  {"slice-height", OPT_ARG_INT,  &slice_height, int_non_neg},
+  {"rectangle",    OPT_ARG_INT,  &use_rectangle,int_non_neg},
+  {"yuv",          OPT_ARG_INT,  &use_yuv,      int_non_neg},
   {"colorspace",   OPT_ARG_INT,  &colorspace,   valid_csp},
-  {"lscale",       OPT_ARG_INT,  &lscale,       (opt_test_f)int_non_neg},
-  {"cscale",       OPT_ARG_INT,  &cscale,       (opt_test_f)int_non_neg},
+  {"lscale",       OPT_ARG_INT,  &lscale,       int_non_neg},
+  {"cscale",       OPT_ARG_INT,  &cscale,       int_non_neg},
   {"filter-strength", OPT_ARG_FLOAT, &filter_strength, NULL},
   {"ati-hack",     OPT_ARG_BOOL, &ati_hack,     NULL},
   {"force-pbo",    OPT_ARG_BOOL, &force_pbo,    NULL},

Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_gl2.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -853,7 +853,7 @@ uninit(void)
 }
 
 static const opt_t subopts[] = {
-  {"yuv",          OPT_ARG_INT,  &use_yuv,      (opt_test_f)int_non_neg},
+  {"yuv",          OPT_ARG_INT,  &use_yuv,      int_non_neg},
   {"glfinish",     OPT_ARG_BOOL, &use_glFinish, NULL},
   {NULL}
 };

Modified: trunk/libvo/vo_ivtv.c
==============================================================================
--- trunk/libvo/vo_ivtv.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_ivtv.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -60,7 +60,7 @@ static int output = -1;
 static char *device = NULL;
 
 static const opt_t subopts[] = {
-  {"output",   OPT_ARG_INT,       &output,       (opt_test_f)int_non_neg},
+  {"output",   OPT_ARG_INT,       &output,       int_non_neg},
   {"device",   OPT_ARG_MSTRZ,     &device,       NULL},
   {NULL}
 };

Modified: trunk/libvo/vo_jpeg.c
==============================================================================
--- trunk/libvo/vo_jpeg.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_jpeg.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -330,8 +330,9 @@ static void check_events(void)
 /** \brief Validation function for values [0-100]
  */
 
-static int int_zero_hundred(int *val)
+static int int_zero_hundred(void *valp)
 {
+    int *val = valp;
     if ( (*val >=0) && (*val<=100) )
         return 1;
     return 0;
@@ -343,15 +344,15 @@ static int preinit(const char *arg)
         {"progressive", OPT_ARG_BOOL,   &jpeg_progressive_mode, NULL},
         {"baseline",    OPT_ARG_BOOL,   &jpeg_baseline,         NULL},
         {"optimize",    OPT_ARG_INT,    &jpeg_optimize,
-                                            (opt_test_f)int_zero_hundred},
+                                            int_zero_hundred},
         {"smooth",      OPT_ARG_INT,    &jpeg_smooth,
-                                            (opt_test_f)int_zero_hundred},
+                                            int_zero_hundred},
         {"quality",     OPT_ARG_INT,    &jpeg_quality,
-                                            (opt_test_f)int_zero_hundred},
+                                            int_zero_hundred},
         {"dpi",         OPT_ARG_INT,    &jpeg_dpi,              NULL},
         {"outdir",      OPT_ARG_MSTRZ,  &jpeg_outdir,           NULL},
         {"subdirs",     OPT_ARG_MSTRZ,  &jpeg_subdirs,          NULL},
-        {"maxfiles",    OPT_ARG_INT,    &jpeg_maxfiles, (opt_test_f)int_pos},
+        {"maxfiles",    OPT_ARG_INT,    &jpeg_maxfiles, int_pos},
         {NULL, 0, NULL, NULL}
     };
     const char *info_message = NULL;

Modified: trunk/libvo/vo_png.c
==============================================================================
--- trunk/libvo/vo_png.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_png.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -283,8 +283,9 @@ static void uninit(void){
 
 static void check_events(void){}
 
-static int int_zero_to_nine(int *sh)
+static int int_zero_to_nine(void *value)
 {
+    int *sh = value;
     if ( (*sh < 0) || (*sh > 9) )
         return 0;
     return 1;
@@ -292,7 +293,7 @@ static int int_zero_to_nine(int *sh)
 
 static const opt_t subopts[] = {
     {"alpha", OPT_ARG_BOOL, &use_alpha, NULL},
-    {"z",   OPT_ARG_INT, &z_compression, (opt_test_f)int_zero_to_nine},
+    {"z",   OPT_ARG_INT, &z_compression, int_zero_to_nine},
     {"outdir",      OPT_ARG_MSTRZ,  &png_outdir,           NULL},
     {NULL}
 };

Modified: trunk/libvo/vo_pnm.c
==============================================================================
--- trunk/libvo/vo_pnm.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_pnm.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -128,7 +128,7 @@ static int preinit(const char *arg)
         {"ascii",       OPT_ARG_BOOL,   &ascii_mode,    NULL},
         {"outdir",      OPT_ARG_MSTRZ,  &pnm_outdir,    NULL},
         {"subdirs",     OPT_ARG_MSTRZ,  &pnm_subdirs,   NULL},
-        {"maxfiles",    OPT_ARG_INT,    &pnm_maxfiles,  (opt_test_f)int_pos},
+        {"maxfiles",    OPT_ARG_INT,    &pnm_maxfiles,  int_pos},
         {NULL, 0, NULL, NULL}
     };
     const char *info_message = NULL;

Modified: trunk/libvo/vo_v4l2.c
==============================================================================
--- trunk/libvo/vo_v4l2.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_v4l2.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -54,7 +54,7 @@ static int output = -1;
 static char *device = NULL;
 
 static const opt_t subopts[] = {
-  {"output",   OPT_ARG_INT,       &output,       (opt_test_f)int_non_neg},
+  {"output",   OPT_ARG_INT,       &output,       int_non_neg},
   {"device",   OPT_ARG_MSTRZ,     &device,       NULL},
   {NULL}
 };

Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_xv.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -612,8 +612,8 @@ static int preinit(const char *arg)
     const opt_t subopts[] =
     {
       /* name         arg type     arg var         test */
-      {  "port",      OPT_ARG_INT, &xv_port,       (opt_test_f)int_pos },
-      {  "adaptor",   OPT_ARG_INT, &xv_adaptor,    (opt_test_f)int_non_neg },
+      {  "port",      OPT_ARG_INT, &xv_port,       int_pos },
+      {  "adaptor",   OPT_ARG_INT, &xv_adaptor,    int_non_neg },
       {  "ck",        OPT_ARG_STR, &ck_src_arg,    xv_test_ck },
       {  "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm },
       {  NULL }

Modified: trunk/libvo/vo_xvmc.c
==============================================================================
--- trunk/libvo/vo_xvmc.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_xvmc.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -382,8 +382,8 @@ static int preinit(const char *arg){
     const opt_t subopts [] =
     {
         /* name         arg type      arg var           test */
-        {  "port",      OPT_ARG_INT,  &xv_port_request, (opt_test_f)int_pos },
-        {  "adaptor",   OPT_ARG_INT,  &xv_adaptor,      (opt_test_f)int_non_neg },
+        {  "port",      OPT_ARG_INT,  &xv_port_request, int_pos },
+        {  "adaptor",   OPT_ARG_INT,  &xv_adaptor,      int_non_neg },
         {  "ck",        OPT_ARG_STR,  &ck_src_arg,      xv_test_ck },
         {  "ck-method", OPT_ARG_STR,  &ck_method_arg,   xv_test_ckm },
         {  "benchmark", OPT_ARG_BOOL, &benchmark,       NULL },

Modified: trunk/libvo/vo_zr2.c
==============================================================================
--- trunk/libvo/vo_zr2.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/libvo/vo_zr2.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -192,14 +192,16 @@ static int get_norm(const char *n) {
 	return -1; /* invalid */
 }
 
-static int nc(const char **norm) {
+static int nc(void *normp) {
+	const char **norm = normp;
 	if (get_norm(*norm) == -1) {
 		ERROR("norm \"%s\" is not supported, choose from PAL, NTSC, SECAM and auto\n", *norm);
 		return 0;
 	} else return 1;
 }
 
-static int pbc(int *prebuf) {
+static int pbc(void *prebufp) {
+	int *prebuf = prebufp;
 	if (*prebuf) WARNING("prebuffering is not yet supported\n");
 	return 1;
 }
@@ -211,8 +213,8 @@ static int preinit(const char *arg) {
 	int norm = VIDEO_MODE_AUTO, prebuf = 0;
 	const opt_t subopts[] = { /* don't want warnings with -Wall... */
 		{ "dev",    OPT_ARG_MSTRZ, &dev_arg,   NULL 	       },
-		{ "prebuf", OPT_ARG_BOOL,  &prebuf,    (opt_test_f)pbc },
-		{ "norm",   OPT_ARG_MSTRZ, &norm_arg,  (opt_test_f)nc  },
+		{ "prebuf", OPT_ARG_BOOL,  &prebuf,    pbc },
+		{ "norm",   OPT_ARG_MSTRZ, &norm_arg,  nc  },
 		{ NULL,     0, 		   NULL,       NULL 	       }
 	};
 

Modified: trunk/subopt-helper.c
==============================================================================
--- trunk/subopt-helper.c	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/subopt-helper.c	Fri Jan  1 14:18:49 2010	(r30164)
@@ -300,15 +300,17 @@ static char const * parse_str( char cons
 /*** common test functions ***/
 
 /** \brief Test if i is not negative */
-int int_non_neg( int * i )
+int int_non_neg(void *iptr)
 {
+  int *i = iptr;
   if ( *i < 0 ) { return 0; }
 
   return 1;
 }
 /** \brief Test if i is positive. */
-int int_pos( int * i )
+int int_pos(void *iptr)
 {
+  int *i = iptr;
   if ( *i > 0 ) { return 1; }
 
   return 0;

Modified: trunk/subopt-helper.h
==============================================================================
--- trunk/subopt-helper.h	Fri Jan  1 13:54:09 2010	(r30163)
+++ trunk/subopt-helper.h	Fri Jan  1 14:18:49 2010	(r30164)
@@ -38,8 +38,8 @@ typedef struct strarg_s
 } strarg_t;
 
 
-int int_non_neg( int * i );
-int int_pos( int * i );
+int int_non_neg(void *iptr);
+int int_pos(void *iptr);
 
 int strargcmp(strarg_t *arg, const char *str);
 int strargcasecmp(strarg_t *arg, char *str);


More information about the MPlayer-cvslog mailing list