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

2015-10-24 Thread Ganesh Ajjanagadde
On Sat, Oct 24, 2015 at 7:04 PM, wm4 wrote: > On Sat, 24 Oct 2015 18:02:36 -0400 > Ganesh Ajjanagadde wrote: > >> For generality, qsort uses a comparator whose elements are void *. This >> makes the comparator have such a form, and thus makes the void * cast of >> the comparator pointer useless.

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

2015-10-24 Thread Ganesh Ajjanagadde
On Sat, Oct 24, 2015 at 7:07 PM, Henrik Gramner wrote: > On Sun, Oct 25, 2015 at 12:02 AM, Ganesh Ajjanagadde > 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 =

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

2015-10-24 Thread Henrik Gramner
On Sun, Oct 25, 2015 at 12:02 AM, Ganesh Ajjanagadde 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 : (

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

2015-10-24 Thread wm4
On Sat, 24 Oct 2015 18:02:36 -0400 Ganesh Ajjanagadde wrote: > For generality, qsort uses a comparator whose elements are void *. This > makes the comparator have such a form, and thus makes the void * cast of > the comparator pointer useless. Furthermore, this makes the code more > consistent wi

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

2015-10-24 Thread Ganesh Ajjanagadde
For generality, qsort uses a comparator whose elements are void *. This makes the comparator have such a form, and thus makes the void * cast of the comparator pointer useless. Furthermore, this makes the code more consistent with other usages of qsort across the codebase. Signed-off-by: Ganesh Aj