[FFmpeg-devel] [PATCH 1/3] avfilter/vf_deshake: use a void * comparator for consistency

Henrik Gramner henrik at gramner.com
Sun Oct 25 01:07:14 CEST 2015


On Sun, Oct 25, 2015 at 12:02 AM, Ganesh Ajjanagadde
<gajjanagadde at gmail.com> wrote:
> -static int cmp(const double *a, const double *b)
> +static int cmp(const void *a, const void *b)
>  {
> -    return *a < *b ? -1 : ( *a > *b ? 1 : 0 );
> +    double va = *(double *)a, vb = *(double *)b;
> +    return va < vb ? -1 : ( va > vb ? 1 : 0 );
>  }

This cast discards the const qualifier and may cause warnings
depending on which compiler and compiler flags you use.


More information about the ffmpeg-devel mailing list