[Mesa-dev] [PATCH 3/3] st/mesa: use CLAMP macro in favour of custom _clamp function

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 21 14:59:18 PST 2014


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/mesa/state_tracker/st_extensions.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 879b954..c36e221 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -39,17 +39,6 @@
 #include "st_extensions.h"
 #include "st_format.h"
 
-static int _clamp(int a, int min, int max)
-{
-   if (a < min)
-      return min;
-   else if (a > max)
-      return max;
-   else
-      return a;
-}
-
-
 /**
  * Query driver to get implementation limits.
  * Note that we have to limit/clamp against Mesa's internal limits too.
@@ -88,11 +77,11 @@ void st_init_limits(struct st_context *st)
    c->MaxRenderbufferSize = c->MaxTextureRectSize;
 
    c->MaxDrawBuffers = c->MaxColorAttachments =
-      _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
+      CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
              1, MAX_DRAW_BUFFERS);
 
    c->MaxDualSourceDrawBuffers
-      = _clamp(screen->get_param(screen, PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS),
+      = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS),
               0, MAX_DRAW_BUFFERS);
 
    c->MaxLineWidth
-- 
1.9.0



More information about the mesa-dev mailing list