diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-19 21:41:50 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-20 10:05:14 +0200 |
commit | 950b3589974e55888fc37369f2d9216a18c1ca84 (patch) | |
tree | 35688719bc6e07c9dd1bf42e48db354d7eb7bf3e /cmdutils.c | |
parent | 52da548c7dabac364cc38e4239edc56a28d0d63c (diff) | |
download | ffmpeg-950b3589974e55888fc37369f2d9216a18c1ca84.tar.gz |
cmdutils: use const AVClass * when senseful
Fix warnings:
cmdutils.c: In function ‘opt_default’:
cmdutils.c:304: warning: initialization discards qualifiers from pointer target type
cmdutils.c: In function ‘set_context_opts’:
cmdutils.c:431: warning: passing argument 2 of ‘alloc_priv_context’ discards qualifiers from pointer target type
cmdutils.c:414: note: expected ‘struct AVClass *’ but argument is of type ‘const struct AVClass *’
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdutils.c b/cmdutils.c index 71d6d33454..5a0c8f378f 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -301,7 +301,7 @@ int opt_default(const char *opt, const char *arg){ AVInputFormat *iformat = NULL; while ((p = av_codec_next(p))) { - AVClass *c = p->priv_class; + const AVClass *c = p->priv_class; if (c && av_find_opt(&c, opt, NULL, 0, 0)) break; } @@ -411,10 +411,11 @@ int opt_timelimit(const char *opt, const char *arg) return 0; } -static void *alloc_priv_context(int size, AVClass *class){ +static void *alloc_priv_context(int size, const AVClass *class) +{ void *p = av_mallocz(size); if (p) { - *(AVClass**)p = class; + *(const AVClass **)p = class; av_opt_set_defaults(p); } return p; |