Mesa (master): util: Use u_math.h's union fi instead of redefining it.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Thu Apr 1 14:18:46 UTC 2010
Module: Mesa
Branch: master
Commit: 982d36667dcb53236cfd9668b56f7e91d49e9f0a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=982d36667dcb53236cfd9668b56f7e91d49e9f0a
Author: José Fonseca <jfonseca at vmware.com>
Date: Thu Apr 1 15:11:05 2010 +0100
util: Use u_math.h's union fi instead of redefining it.
---
src/gallium/auxiliary/util/u_half.h | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_half.h b/src/gallium/auxiliary/util/u_half.h
index 464d43d..54e7c74 100644
--- a/src/gallium/auxiliary/util/u_half.h
+++ b/src/gallium/auxiliary/util/u_half.h
@@ -2,6 +2,7 @@
#define U_HALF_H
#include "pipe/p_compiler.h"
+#include "u_math.h"
extern uint32_t util_half_to_float_mantissa_table[2048];
extern uint32_t util_half_to_float_exponent_table[64];
@@ -31,8 +32,8 @@ util_half_to_floatui(half h)
static INLINE float
util_half_to_float(half h)
{
- union {float f; uint32_t v;} r;
- r.v = util_half_to_floatui(h);
+ union fi r;
+ r.ui = util_half_to_floatui(h);
return r.f;
}
@@ -47,9 +48,9 @@ util_floatui_to_half(uint32_t v)
static INLINE half
util_float_to_half(float f)
{
- union {float f; uint32_t v;} i;
+ union fi i;
i.f = f;
- return util_floatui_to_half(i.v);
+ return util_floatui_to_half(i.ui);
}
#endif /* U_HALF_H */
More information about the mesa-commit
mailing list