[Mesa-dev] [PATCH 2/3] st/mesa: use MAX2 macro in favour of custom _maxf function

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


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

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index a909b71..879b954 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -39,11 +39,6 @@
 #include "st_extensions.h"
 #include "st_format.h"
 
-static float _maxf(float a, float b)
-{
-   return (a > b) ? a : b;
-}
-
 static int _clamp(int a, int min, int max)
 {
    if (a < min)
@@ -101,17 +96,17 @@ void st_init_limits(struct st_context *st)
               0, MAX_DRAW_BUFFERS);
 
    c->MaxLineWidth
-      = _maxf(1.0f, screen->get_paramf(screen,
+      = MAX2(1.0f, screen->get_paramf(screen,
                                        PIPE_CAPF_MAX_LINE_WIDTH));
    c->MaxLineWidthAA
-      = _maxf(1.0f, screen->get_paramf(screen,
+      = MAX2(1.0f, screen->get_paramf(screen,
                                        PIPE_CAPF_MAX_LINE_WIDTH_AA));
 
    c->MaxPointSize
-      = _maxf(1.0f, screen->get_paramf(screen,
+      = MAX2(1.0f, screen->get_paramf(screen,
                                        PIPE_CAPF_MAX_POINT_WIDTH));
    c->MaxPointSizeAA
-      = _maxf(1.0f, screen->get_paramf(screen,
+      = MAX2(1.0f, screen->get_paramf(screen,
                                        PIPE_CAPF_MAX_POINT_WIDTH_AA));
    /* called after _mesa_create_context/_mesa_init_point, fix default user
     * settable max point size up
@@ -124,7 +119,7 @@ void st_init_limits(struct st_context *st)
    c->MinPointSizeAA = 0.0f;
 
    c->MaxTextureMaxAnisotropy
-      = _maxf(2.0f, screen->get_paramf(screen,
+      = MAX2(2.0f, screen->get_paramf(screen,
                                  PIPE_CAPF_MAX_TEXTURE_ANISOTROPY));
 
    c->MaxTextureLodBias
-- 
1.9.0



More information about the mesa-dev mailing list