OSDN Git Service

gallium/util: fix util_color_[un]pack[-ub] to be strict aliasing safe
authorRoland Scheidegger <sroland@vmware.com>
Mon, 7 Dec 2009 19:35:42 +0000 (20:35 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Mon, 7 Dec 2009 19:35:42 +0000 (20:35 +0100)
commit3456f9149b3009fcfce80054759d05883d3c4ee5
treee584ac25fa3bbe29c15ab06eae1dccdf3dbf708a
parentc36d1aacf4c70d76165c91cd7048c0f9f43b8571
gallium/util: fix util_color_[un]pack[-ub] to be strict aliasing safe

use pointer to union instead of void pointer.
gcc complained a lot, depending what the pointer originally actually was.
Looks like it's in fact maybe legal to cast for instance uint pointers to
union pointers as long as union contains a uint type, hence use this with some
callers, other just use union util_color in the first place.
src/gallium/auxiliary/util/u_clear.h
src/gallium/auxiliary/util/u_pack_color.h
src/gallium/drivers/cell/ppu/cell_clear.c
src/gallium/drivers/llvmpipe/lp_clear.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/softpipe/sp_clear.c
src/gallium/drivers/svga/svga_pipe_clear.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