On Mon, 28 Oct 2013 02:58:14 +0100, Vittorio Giovara
<[email protected]> wrote:
> ---
> libavfilter/avfilter.c | 4 ++++
> libavfilter/avfiltergraph.c | 6 ++++++
> libavfilter/graphparser.c | 3 +++
> 3 files changed, 13 insertions(+)
>
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index b18c0cb..c2691e5 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -284,7 +284,11 @@ AVFilter *avfilter_get_by_name(const char *name)
>
> while ((f = avfilter_next(f)))
> if (!strcmp(f->name, name))
> +#if !FF_API_NOCONST_GET_NAME
> return f;
> +#else
> + return (AVFilter *)f;
> +#endif
This probably won't solve anything, at least gcc still warns when you strip
const like this.
>
> return NULL;
> }
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index 0fc385c..6414816 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -316,6 +316,9 @@ static int query_formats(AVFilterGraph *graph, AVClass
> *log_ctx)
>
> if (convert_needed) {
> AVFilterContext *convert;
> +#if !FF_API_NOCONST_GET_NAME
> + const
> +#endif
> AVFilter *filter;
> AVFilterLink *inlink, *outlink;
> char scale_args[256];
> @@ -782,6 +785,9 @@ static int graph_insert_fifos(AVFilterGraph *graph,
> AVClass *log_ctx)
> for (j = 0; j < f->nb_inputs; j++) {
> AVFilterLink *link = f->inputs[j];
> AVFilterContext *fifo_ctx;
> +#if !FF_API_NOCONST_GET_NAME
> + const
> +#endif
> AVFilter *fifo;
> char name[32];
>
> diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
> index 00764b6..88cc254 100644
> --- a/libavfilter/graphparser.c
> +++ b/libavfilter/graphparser.c
> @@ -94,6 +94,9 @@ static char *parse_link_name(const char **buf, void
> *log_ctx)
> static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int
> index,
> const char *filt_name, const char *args, void
> *log_ctx)
> {
> +#if !FF_API_NOCONST_GET_NAME
> + const
> +#endif
All those #ifs should be unnecessary. You can assign a non-const variable to a
const one (after all it's just saying you won't modify it, even though you are
allowed to), just not the other way around.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel