diff options
author | Timothy Arceri <[email protected]> | 2020-07-03 12:06:09 +1000 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-08 03:04:03 +0000 |
commit | 4686a956212ac8e9b7be1b6a10672cb606095f8f (patch) | |
tree | d85b61899f62902721472484bb30ed73ca706d4e /src/gallium | |
parent | f472c9844309f20b19f179cffc84c00a561c8f70 (diff) |
r600/radeonsi: silence zero-length-bounds gcc warnings
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe_common.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 8 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe_common.h b/src/gallium/drivers/r600/r600_pipe_common.h index 2ecd03845e6..8accf7eae98 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.h +++ b/src/gallium/drivers/r600/r600_pipe_common.h @@ -289,7 +289,7 @@ struct r600_mmio_counter { }; union r600_mmio_counters { - struct { + struct r600_mmio_counters_named { /* For global GPU load including SDMA. */ struct r600_mmio_counter gpu; @@ -320,7 +320,7 @@ union r600_mmio_counters { struct r600_mmio_counter cp_dma; struct r600_mmio_counter scratch_ram; } named; - unsigned array[0]; + unsigned array[sizeof(struct r600_mmio_counters_named) / sizeof(unsigned)]; }; struct r600_memory_object { diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 467538c76cd..14b29db9b85 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -432,7 +432,7 @@ struct si_mmio_counter { }; union si_mmio_counters { - struct { + struct si_mmio_counters_named { /* For global GPU load including SDMA. */ struct si_mmio_counter gpu; @@ -463,7 +463,8 @@ union si_mmio_counters { struct si_mmio_counter cp_dma; struct si_mmio_counter scratch_ram; } named; - unsigned array[0]; + + unsigned array[sizeof(struct si_mmio_counters_named) / sizeof(unsigned)]; }; struct si_memory_object { diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index a45b18c827c..ab655498a1d 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -176,7 +176,7 @@ struct si_vertex_elements { }; union si_state { - struct { + struct si_state_named { struct si_state_blend *blend; struct si_state_rasterizer *rasterizer; struct si_state_dsa *dsa; @@ -189,7 +189,7 @@ union si_state { struct si_pm4_state *vs; struct si_pm4_state *ps; } named; - struct si_pm4_state *array[0]; + struct si_pm4_state *array[sizeof(struct si_state_named) / sizeof(struct si_pm4_state *)]; }; #define SI_STATE_IDX(name) (offsetof(union si_state, named.name) / sizeof(struct si_pm4_state *)) @@ -203,7 +203,7 @@ static inline unsigned si_states_that_always_roll_context(void) } union si_state_atoms { - struct { + struct si_atoms_s { /* The order matters. */ struct si_atom render_cond; struct si_atom streamout_begin; @@ -228,7 +228,7 @@ union si_state_atoms { struct si_atom window_rectangles; struct si_atom shader_query; } s; - struct si_atom array[0]; + struct si_atom array[sizeof(struct si_atoms_s) / sizeof(struct si_atom)]; }; #define SI_ATOM_BIT(name) (1 << (offsetof(union si_state_atoms, s.name) / sizeof(struct si_atom))) |