Mercurial > mplayer.hg
changeset 36582:b28f3ff37ae7
Use av_unused for unused arguments instead of various hacks.
author | reimar |
---|---|
date | Mon, 20 Jan 2014 22:08:48 +0000 |
parents | 292a9e879fd0 |
children | 322ffa4a22d2 |
files | 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 |
diffstat | 7 files changed, 21 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/libmenu/menu_chapsel.c Mon Jan 20 22:08:47 2014 +0000 +++ b/libmenu/menu_chapsel.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ 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;
--- a/libmenu/menu_filesel.c Mon Jan 20 22:08:47 2014 +0000 +++ b/libmenu/menu_filesel.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ 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;
--- a/libmenu/menu_pt.c Mon Jan 20 22:08:47 2014 +0000 +++ b/libmenu/menu_pt.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ 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;
--- a/libmenu/menu_txt.c Mon Jan 20 22:08:47 2014 +0000 +++ b/libmenu/menu_txt.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ #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;
--- a/m_option.c Mon Jan 20 22:08:47 2014 +0000 +++ b/m_option.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ // 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 @@ #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 @@ 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 @@ 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)); }
--- a/stream/asf_mmst_streaming.c Mon Jan 20 22:08:47 2014 +0000 +++ b/stream/asf_mmst_streaming.c Mon Jan 20 22:08:48 2014 +0000 @@ -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_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)
--- a/stream/asf_streaming.c Mon Jan 20 22:08:47 2014 +0000 +++ b/stream/asf_streaming.c Mon Jan 20 22:08:48 2014 +0000 @@ -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 @@ 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 ) {