[Mesa-dev] [PATCH 4/4] xlib: Use float type in calculation.

Matt Turner mattst88 at gmail.com
Thu May 26 18:28:50 UTC 2016


---
 src/mesa/drivers/x11/xm_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 3eaa6cf..15ac130 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -149,8 +149,8 @@ gamma_adjust( GLfloat gamma, GLint value, GLint max )
       return value;
    }
    else {
-      double x = (double) value / (double) max;
-      return lroundf(max * pow(x, 1.0F/gamma));
+      float x = (float) value / (float) max;
+      return lroundf(max * powf(x, 1.0F/gamma));
    }
 }
 
-- 
2.7.3



More information about the mesa-dev mailing list