Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_deshake: use a void * comparator for consistency
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. Furthermore, this makes the code more >> consistent with other usages of qsort across the codebase. >> >> Signed-off-by: Ganesh Ajjanagadde >> --- > > Entire patchset (1-3) LGTM, if it really does not cause new warnings. > > Maybe instead of "libc" it would be good to write "Standard C", but it > probably doesn't matter at all. Since you pointed it out, changed while pushing. Thanks. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_deshake: use a void * comparator for consistency
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 = *(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. no warnings unfortunately; fixed. See also new patch. > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_deshake: use a void * comparator for consistency
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 : ( va > vb ? 1 : 0 ); > } This cast discards the const qualifier and may cause warnings depending on which compiler and compiler flags you use. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_deshake: use a void * comparator for consistency
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 with other usages of qsort across the codebase. > > Signed-off-by: Ganesh Ajjanagadde > --- Entire patchset (1-3) LGTM, if it really does not cause new warnings. Maybe instead of "libc" it would be good to write "Standard C", but it probably doesn't matter at all. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel