gallium: fix more potential strict aliasing issues
authorRoland Scheidegger <sroland@vmware.com>
Tue, 8 Dec 2009 18:13:48 +0000 (19:13 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 8 Dec 2009 18:17:08 +0000 (19:17 +0100)
commitee1720b99dfb5964962f2346406a4e3e88374a68
treecb07d1ad5ea1a76b262d15c4a47fff97290242cd
parent72362a5cd41d97b770980c28fe6719c556f12ab7
gallium: fix more potential strict aliasing issues

In particular, gcc man page warns that
union a_union {
   int i;
   double d;
};

int f() {
   double d = 3.0;
   return ((union a_union *) &d)->i;
}

"might" not be ok (why not?), even though it doesn't seem to generate
any warnings. Hence don't use this and do the extra step to actually use
assignment to get the values in/out of the union.
This changes parts of 3456f9149b3009fcfce80054759d05883d3c4ee5.
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/svga/svga_pipe_sampler.c
src/gallium/state_trackers/vega/vg_translate.c
src/mesa/state_tracker/st_atom_pixeltransfer.c