diff options
author | Roland Scheidegger <sroland@vmware.com> | 2009-12-07 20:35:42 +0100 |
---|---|---|
committer | Roland Scheidegger <sroland@vmware.com> | 2009-12-07 20:35:42 +0100 |
commit | 3456f9149b3009fcfce80054759d05883d3c4ee5 (patch) | |
tree | e584ac25fa3bbe29c15ab06eae1dccdf3dbf708a /src/gallium/drivers/cell | |
parent | c36d1aacf4c70d76165c91cd7048c0f9f43b8571 (diff) |
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.
Diffstat (limited to 'src/gallium/drivers/cell')
-rw-r--r-- | src/gallium/drivers/cell/ppu/cell_clear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c index 79ad687ea9..3a3f968a49 100644 --- a/src/gallium/drivers/cell/ppu/cell_clear.c +++ b/src/gallium/drivers/cell/ppu/cell_clear.c @@ -59,9 +59,9 @@ cell_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, if (buffers & PIPE_CLEAR_COLOR) { uint surfIndex = 0; - uint clearValue; + union util_color uc; - util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &clearValue); + util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &uc); /* Build a CLEAR command and place it in the current batch buffer */ STATIC_ASSERT(sizeof(struct cell_command_clear_surface) % 16 == 0); @@ -70,7 +70,7 @@ cell_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, cell_batch_alloc16(cell, sizeof(*clr)); clr->opcode[0] = CELL_CMD_CLEAR_SURFACE; clr->surface = surfIndex; - clr->value = clearValue; + clr->value = uc.ui; } if (buffers & PIPE_CLEAR_DEPTHSTENCIL) { |