[Mesa-dev] [PATCH] st/mesa: add comment to explain _min(), _maxf(), etc. functions

Marek Olšák maraeo at gmail.com
Tue Feb 25 11:32:15 PST 2014


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Feb 25, 2014 at 5:54 PM, Brian Paul <brianp at vmware.com> wrote:
> ---
>  src/mesa/state_tracker/st_extensions.c |    6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index 47b975b..727fb1a 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -39,6 +39,12 @@
>  #include "st_extensions.h"
>  #include "st_format.h"
>
> +
> +/*
> + * Note: we use these function rather than the MIN2, MAX2, CLAMP macros to
> + * avoid evaluating arguments (which are often function calls) more than once.
> + */
> +
>  static unsigned _min(unsigned a, unsigned b)
>  {
>     return (a < b) ? a : b;
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list