Mesa (master): util: Make half float lookup tables constant.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Apr 6 15:01:26 UTC 2010


Module: Mesa
Branch: master
Commit: 04ea6f5dd84bb91e91225133f3a67e38ed7a3fad
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ea6f5dd84bb91e91225133f3a67e38ed7a3fad

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sun Apr  4 20:43:52 2010 +0100

util: Make half float lookup tables constant.

---

 src/gallium/auxiliary/util/u_half.h  |   10 +++++-----
 src/gallium/auxiliary/util/u_half.py |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_half.h b/src/gallium/auxiliary/util/u_half.h
index a28b1fd..bc41c65 100644
--- a/src/gallium/auxiliary/util/u_half.h
+++ b/src/gallium/auxiliary/util/u_half.h
@@ -8,11 +8,11 @@
 extern "C" {
 #endif
 
-extern uint32_t util_half_to_float_mantissa_table[2048];
-extern uint32_t util_half_to_float_exponent_table[64];
-extern uint32_t util_half_to_float_offset_table[64];
-extern uint16_t util_float_to_half_base_table[512];
-extern uint8_t util_float_to_half_shift_table[512];
+extern const uint32_t util_half_to_float_mantissa_table[2048];
+extern const uint32_t util_half_to_float_exponent_table[64];
+extern const uint32_t util_half_to_float_offset_table[64];
+extern const uint16_t util_float_to_half_base_table[512];
+extern const uint8_t util_float_to_half_shift_table[512];
 
 /*
  * Note that if the half float is a signaling NaN, the x87 FPU will turn
diff --git a/src/gallium/auxiliary/util/u_half.py b/src/gallium/auxiliary/util/u_half.py
index a92f758..8007482 100644
--- a/src/gallium/auxiliary/util/u_half.py
+++ b/src/gallium/auxiliary/util/u_half.py
@@ -56,7 +56,7 @@ def begin(t, n, l):
 	table_index = 0
 	table_length = l
 	print
-	print t + " " + n + "[" + str(l) + "] = {"
+	print "const " + t + " " + n + "[" + str(l) + "] = {"
 
 def value(v):
 	global table_index




More information about the mesa-commit mailing list