summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_half.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-04-02 00:34:44 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-04-02 00:47:11 +0200
commit7bb54c99a466883af3ac3e79426def17dcfa8d89 (patch)
tree385a6e349e8b21683b97a98cec62107a0f1b98e3 /src/gallium/auxiliary/util/u_half.c
parente40fce13e152ecf929c899ed38a8e5f7d198c738 (diff)
Revert "util: Init half-float tables on demand."
This reverts commit 950300eb255f0e3507bf2757d16c3b5bc8ff3471.
Diffstat (limited to 'src/gallium/auxiliary/util/u_half.c')
-rw-r--r--src/gallium/auxiliary/util/u_half.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/util/u_half.c b/src/gallium/auxiliary/util/u_half.c
index 64eaa00dcc..4611b201b9 100644
--- a/src/gallium/auxiliary/util/u_half.c
+++ b/src/gallium/auxiliary/util/u_half.c
@@ -50,6 +50,7 @@
*/
#include "util/u_half.h"
+#include "util/u_init.h"
uint32_t util_half_to_float_mantissa_table[2048];
uint32_t util_half_to_float_exponent_table[64];
@@ -57,15 +58,10 @@ uint32_t util_half_to_float_offset_table[64];
uint16_t util_float_to_half_base_table[512];
uint8_t util_float_to_half_shift_table[512];
-void util_half_init_tables(void)
+static void util_half_init_tables(void)
{
- static boolean inited = FALSE;
int i;
- if (inited) {
- return;
- }
-
/* zero */
util_half_to_float_mantissa_table[0] = 0;
@@ -157,6 +153,6 @@ void util_half_init_tables(void)
util_float_to_half_base_table[256 + i] = util_float_to_half_base_table[i] | 0x8000;
util_float_to_half_shift_table[256 + i] = util_float_to_half_shift_table[i];
}
-
- inited = TRUE;
}
+
+UTIL_INIT(util_half_init_tables);