projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5767ce7
)
i965: Use a union to bitcast a float
author
Matt Turner
<mattst88@gmail.com>
Thu, 19 Oct 2017 05:16:05 +0000
(22:16 -0700)
committer
Matt Turner
<mattst88@gmail.com>
Thu, 19 Oct 2017 05:16:46 +0000
(22:16 -0700)
... which does not break C's aliasing rules.
src/mesa/drivers/dri/i965/gen6_constant_state.c
patch
|
blob
|
history
diff --git
a/src/mesa/drivers/dri/i965/gen6_constant_state.c
b/src/mesa/drivers/dri/i965/gen6_constant_state.c
index 62ad6b04976fbda57ff094726ba437fa45f7a386..121ba6725754a0708b640e95373e5e3a93f594f1 100644
(file)
--- 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