Browse Source

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 *’
tags/n0.8
Stefano Sabatini 14 years ago
parent
commit
950b358997
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      cmdutils.c

+ 4
- 3
cmdutils.c View File

@@ -301,7 +301,7 @@ int opt_default(const char *opt, const char *arg){
AVInputFormat *iformat = NULL; AVInputFormat *iformat = NULL;


while ((p = av_codec_next(p))) { 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)) if (c && av_find_opt(&c, opt, NULL, 0, 0))
break; break;
} }
@@ -411,10 +411,11 @@ int opt_timelimit(const char *opt, const char *arg)
return 0; 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); void *p = av_mallocz(size);
if (p) { if (p) {
*(AVClass**)p = class;
*(const AVClass **)p = class;
av_opt_set_defaults(p); av_opt_set_defaults(p);
} }
return p; return p;


Loading…
Cancel
Save