[FFmpeg-devel] [PATCH] avutil/qsort: use do while form for AV_QSORT

Clément Bœsch u at pkh.me
Fri Oct 23 07:55:16 CEST 2015


On Thu, Oct 22, 2015 at 10:53:10PM -0400, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavutil/qsort.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavutil/qsort.h b/libavutil/qsort.h
> index 30edcc8..f079661 100644
> --- a/libavutil/qsort.h
> +++ b/libavutil/qsort.h
> @@ -27,7 +27,7 @@
>   * to construct input that requires O(n^2) time but this is very unlikely to
>   * happen with non constructed input.
>   */
> -#define AV_QSORT(p, num, type, cmp) {\
> +#define AV_QSORT(p, num, type, cmp) do { \
>      void *stack[64][2];\
>      int sp= 1;\
>      stack[0][0] = p;\
> @@ -89,7 +89,7 @@
>              }\
>          }\
>      }\
> -}
> +} while (0)
>  

Probably relevant for the AV_MSORT() below too

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151023/5113410b/attachment.sig>


More information about the ffmpeg-devel mailing list