Mesa (master): mesa: add macros MIN3 and MAX3

Marek Olšák mareko at kemper.freedesktop.org
Wed Apr 27 04:17:53 PDT 2011


Module: Mesa
Branch: master
Commit: 069a9766a9bf62c3c6caacd0ce5fb30ece8a0eef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=069a9766a9bf62c3c6caacd0ce5fb30ece8a0eef

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Apr 27 12:53:58 2011 +0200

mesa: add macros MIN3 and MAX3

---

 src/mesa/main/macros.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 86a58cc..01e4d20 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -669,6 +669,10 @@ do {                                    \
 /** Maximum of two values: */
 #define MAX2( A, B )   ( (A)>(B) ? (A) : (B) )
 
+/** Minimum and maximum of three values: */
+#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
 /** Dot product of two 2-element vectors */
 #define DOT2( a, b )  ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )
 



More information about the mesa-commit mailing list