summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-10-18 22:16:05 -0700
committerMatt Turner <[email protected]>2017-10-18 22:16:46 -0700
commite9796ebca7d2977700ff51ade9193e33368bd4af (patch)
tree9ace904f5c03f588122819b61dc9fe1167ea24e6 /src/mesa/drivers
parent5767ce7d0d1493f3ea9663f98e06012fa3695071 (diff)
i965: Use a union to bitcast a float
... which does not break C's aliasing rules.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_constant_state.c3
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