[MPlayer-cvslog] r36678 - in trunk: libmenu/menu_chapsel.c libmenu/menu_filesel.c libmenu/menu_pt.c libmenu/menu_txt.c m_option.c stream/asf_mmst_streaming.c stream/asf_streaming.c

reimar subversion at mplayerhq.hu
Mon Jan 20 23:08:48 CET 2014


Author: reimar
Date: Mon Jan 20 23:08:48 2014
New Revision: 36678

Log:
Use av_unused for unused arguments instead of various hacks.

Modified:
   trunk/libmenu/menu_chapsel.c
   trunk/libmenu/menu_filesel.c
   trunk/libmenu/menu_pt.c
   trunk/libmenu/menu_txt.c
   trunk/m_option.c
   trunk/stream/asf_mmst_streaming.c
   trunk/stream/asf_streaming.c

Modified: trunk/libmenu/menu_chapsel.c
==============================================================================
--- trunk/libmenu/menu_chapsel.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/libmenu/menu_chapsel.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -25,6 +25,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "libavutil/attributes.h"
+
 #include "config.h"
 
 #include "m_struct.h"
@@ -156,10 +158,8 @@ static void close_cs (menu_t* menu)
   menu_list_uninit (menu, NULL);
 }
 
-static int open_cs (menu_t* menu, char* args)
+static int open_cs (menu_t* menu, char* av_unused args)
 {
-  args = NULL;
-
   menu->draw = menu_list_draw;
   menu->read_cmd = read_cmd;
   menu->close = close_cs;

Modified: trunk/libmenu/menu_filesel.c
==============================================================================
--- trunk/libmenu/menu_filesel.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/libmenu/menu_filesel.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -29,6 +29,7 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include "libavutil/attributes.h"
 
 #include "config.h"
 #include "mp_msg.h"
@@ -416,11 +417,10 @@ static void clos(menu_t* menu) {
   free(mpriv->dir);
 }
 
-static int open_fs(menu_t* menu, char* args) {
+static int open_fs(menu_t* menu, char* av_unused args) {
   char *path = mpriv->path;
   int r = 0;
   char wd[PATH_MAX+1], b[PATH_MAX+1];
-  args = NULL; // Warning kill
 
   menu->draw = menu_list_draw;
   menu->read_cmd = read_cmd;

Modified: trunk/libmenu/menu_pt.c
==============================================================================
--- trunk/libmenu/menu_pt.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/libmenu/menu_pt.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -21,6 +21,8 @@
 #include <string.h>
 //#include <libgen.h>
 
+#include "libavutil/attributes.h"
+
 #include "config.h"
 #include "mp_msg.h"
 #include "help_mp.h"
@@ -127,13 +129,11 @@ static void close_menu(menu_t* menu) {
   menu_list_uninit(menu,NULL);
 }
 
-static int op(menu_t* menu, char* args) {
+static int op(menu_t* menu, char* av_unused args) {
   play_tree_t* i;
   list_entry_t* e;
   play_tree_iter_t* playtree_iter = mpctx_get_playtree_iter(menu->ctx);
 
-  args = NULL; // Warning kill
-
   menu->draw = menu_list_draw;
   menu->read_cmd = read_cmd;
   menu->read_key = read_key;

Modified: trunk/libmenu/menu_txt.c
==============================================================================
--- trunk/libmenu/menu_txt.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/libmenu/menu_txt.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -24,6 +24,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "libavutil/attributes.h"
+
 #include "libmpcodecs/img_format.h"
 #include "libmpcodecs/mp_image.h"
 
@@ -129,13 +131,12 @@ static void draw(menu_t* menu,mp_image_t
 
 #define BUF_SIZE 1024
 
-static int open_txt(menu_t* menu, char* args) {
+static int open_txt(menu_t* menu, char* av_unused args) {
   FILE* fd;
   char buf[BUF_SIZE];
   char *l;
   int s;
   int pos = 0, r = 0;
-  args = NULL; // Warning kill
 
   menu->draw = draw;
   menu->read_cmd = read_cmd;

Modified: trunk/m_option.c
==============================================================================
--- trunk/m_option.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/m_option.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -36,6 +36,7 @@
 #include "mp_global.h"
 #include "stream/url.h"
 #include "libavutil/avstring.h"
+#include "libavutil/attributes.h"
 
 // Don't free for 'production' atm
 #ifndef MP_DEBUG
@@ -155,10 +156,9 @@ const m_option_type_t m_option_type_flag
 
 // Integer
 
-static int parse_int(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
+static int parse_int(const m_option_t* opt,const char *name, const char *param, void* dst, int av_unused src) {
   long long tmp_int;
   char *endptr;
-  src = 0;
 
   if (param == NULL)
     return M_OPT_MISSING_PARAM;
@@ -228,10 +228,9 @@ const m_option_type_t m_option_type_int6
 #undef VAL
 #define VAL(x) (*(double*)(x))
 
-static int parse_double(const m_option_t* opt,const char *name, const char *param, void* dst, int src) {
+static int parse_double(const m_option_t* opt,const char *name, const char *param, void* dst, int av_unused src) {
   double tmp_float;
   char* endptr;
-  src = 0;
 
   if (param == NULL)
     return M_OPT_MISSING_PARAM;
@@ -277,8 +276,7 @@ static int parse_double(const m_option_t
   return 1;
 }
 
-static char* print_double(const m_option_t* opt,  const void* val) {
-  opt = NULL;
+static char* print_double(const m_option_t* av_unused opt,  const void* val) {
   return dup_printf("%f",VAL(val));
 }
 
@@ -305,8 +303,7 @@ static int parse_float(const m_option_t*
     return r;
 }
 
-static char* print_float(const m_option_t* opt,  const void* val) {
-  opt = NULL;
+static char* print_float(const m_option_t* av_unused opt,  const void* val) {
   return dup_printf("%f",VAL(val));
 }
 

Modified: trunk/stream/asf_mmst_streaming.c
==============================================================================
--- trunk/stream/asf_mmst_streaming.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/stream/asf_mmst_streaming.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -34,6 +34,8 @@
 #include <errno.h>
 #include <inttypes.h>
 
+#include "libavutil/attributes.h"
+
 #include "config.h"
 
 #include "mp_msg.h"
@@ -505,13 +507,9 @@ static int asf_mmst_streaming_read( int 
 
 }
 
-static int asf_mmst_streaming_seek( int fd, int64_t pos, streaming_ctrl_t *streaming_ctrl )
+static int asf_mmst_streaming_seek( int av_unused fd, int64_t av_unused pos, streaming_ctrl_t * av_unused streaming_ctrl )
 {
 	return -1;
-	// Shut up gcc warning
-	fd++;
-	pos++;
-	streaming_ctrl=NULL;
 }
 
 int asf_mmst_streaming_start(stream_t *stream)

Modified: trunk/stream/asf_streaming.c
==============================================================================
--- trunk/stream/asf_streaming.c	Mon Jan 20 23:08:47 2014	(r36677)
+++ trunk/stream/asf_streaming.c	Mon Jan 20 23:08:48 2014	(r36678)
@@ -43,6 +43,7 @@
 #include "network.h"
 #include "tcp.h"
 
+#include "libavutil/attributes.h"
 #include "libavutil/intreadwrite.h"
 
 #include "libmpdemux/asfguid.h"
@@ -454,12 +455,8 @@ static int asf_http_streaming_read( int 
   return read;
 }
 
-static int asf_http_streaming_seek( int fd, int64_t pos, streaming_ctrl_t *streaming_ctrl ) {
+static int asf_http_streaming_seek( int av_unused fd, int64_t av_unused pos, streaming_ctrl_t * av_unused streaming_ctrl ) {
 	return -1;
-	// to shut up gcc warning
-	fd++;
-	pos++;
-	streaming_ctrl=NULL;
 }
 
 static int asf_header_check( HTTP_header_t *http_hdr ) {


More information about the MPlayer-cvslog mailing list