[FFmpeg-devel] [PATCH 2/2] fmin/fmax/fminf/fmaxf implementation for djgpp libc

Michael Niedermayer michael at niedermayer.cc
Tue Nov 13 02:58:40 EET 2018


On Mon, Nov 12, 2018 at 11:51:26PM +1100, Peter Ross wrote:
> ---
>  compat/djgpp/math.h | 22 ++++++++++++++++++++++
>  configure           |  1 +
>  2 files changed, 23 insertions(+)
>  create mode 100644 compat/djgpp/math.h
> 
> diff --git a/compat/djgpp/math.h b/compat/djgpp/math.h
> new file mode 100644
> index 0000000000..28fae5212e
> --- /dev/null
> +++ b/compat/djgpp/math.h
> @@ -0,0 +1,22 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#define fmin(x, y) ((x) > (y) ? (y) : ((x) == (x) ? (x) : (y)))
> +#define fmax(x, y) ((x) < (y) ? (y) : ((x) == (x) ? (x) : (y)))
> +#define fminf(x, y) fmin(x, y)
> +#define fmaxf(x, y) fmax(x, y)

these evaluate the arguments multiple times. This could be unexpected
also the way this tests for NaN is not guranteed to work i think


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Never trust a computer, one day, it may think you are the virus. -- Compn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181113/ac8b6bb6/attachment.sig>


More information about the ffmpeg-devel mailing list