summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/imports.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-09-03 12:19:15 -0600
committerBrian Paul <[email protected]>2012-09-03 18:07:41 -0600
commit56ccdf7e30f5bc1bc6b71d49bad2a9049ae170c4 (patch)
tree1d890a1708b7262c080444a8cd57948ea49a9edd /src/mesa/main/imports.h
parentf44bda17f515c411071ca8744ebd96039d9c583b (diff)
mesa: remove SQRTF, use sqrtf. Convert INV_SQRT() to inline function.
We were already defining sqrtf where we don't have the C99 version. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r--src/mesa/main/imports.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 60b0f11af86..abf216c99ac 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -96,18 +96,6 @@ typedef union { GLfloat f; GLint i; } fi_type;
#define DEG2RAD (M_PI/180.0)
-/***
- *** SQRTF: single-precision square root
- ***/
-#define SQRTF(X) (float) sqrt((float) (X))
-
-
-/***
- *** INV_SQRTF: single-precision inverse square root
- ***/
-#define INV_SQRTF(X) (1.0F / SQRTF(X))
-
-
/**
* \name Work-arounds for platforms that lack C99 math functions
*/
@@ -157,6 +145,16 @@ static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; }
/*@}*/
+
+/** single-precision inverse square root */
+static inline float
+INV_SQRTF(float x)
+{
+ /* XXX we could try Quake's fast inverse square root function here */
+ return 1.0F / sqrtf(x);
+}
+
+
/***
*** LOG2: Log base 2 of float
***/