[Mesa-dev] [PATCH 2/2] st/mesa: remove _min(), _maxf(), _clamp()

Brian Paul brianp at vmware.com
Fri Jan 10 15:09:53 PST 2014


On 01/10/2014 03:59 PM, Marek Olšák wrote:
> I guess we should make MIN2 and friends inline functions to prevent
> evaluating its parameters multiple times.

But MIN2, MAX2, etc. are used for uint, int and float.


> For example,
> MIN2(get_param(), Y) calls get_param() twice. It's not very important
> in this case though.

Hmm, I didn't even think of that.  I'm tempted to leave it as-is now and 
simply add a comment about why the inline funcs are used instead of the 
macros.

-Brian



More information about the mesa-dev mailing list