diff options
author | Matt Turner <mattst88@gmail.com> | 2017-10-18 22:16:05 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2017-10-18 22:16:46 -0700 |
commit | e9796ebca7d2977700ff51ade9193e33368bd4af (patch) | |
tree | 9ace904f5c03f588122819b61dc9fe1167ea24e6 | |
parent | 5767ce7d0d1493f3ea9663f98e06012fa3695071 (diff) |
i965: Use a union to bitcast a float
... which does not break C's aliasing rules.
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_constant_state.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_constant_state.c b/src/mesa/drivers/dri/i965/gen6_constant_state.c index 62ad6b04976..121ba672575 100644 --- a/src/mesa/drivers/dri/i965/gen6_constant_state.c +++ b/src/mesa/drivers/dri/i965/gen6_constant_state.c @@ -32,7 +32,8 @@ static uint32_t f_as_u32(float f) { - return *(uint32_t *)&f; + union fi fi = { .f = f }; + return fi.ui; } static uint32_t |