[Mesa-dev] [PATCH] radeonsi: use unreachable to fix a warning
Marek Olšák
maraeo at gmail.com
Sun Apr 2 22:47:37 UTC 2017
Pushed. Thanks.
Marek
On Sun, Apr 2, 2017 at 7:22 PM, Grazvydas Ignotas <notasas at gmail.com> wrote:
> si_state.c: In function ‘si_make_texture_descriptor’:
> si_state.c:3240:25: warning: ‘num_format’ may be used uninitialized
> si_state.c:3240:12: warning: ‘data_format’ may be used uninitialized
>
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
> ---
> no commit access (currently pending)
>
> src/gallium/drivers/radeonsi/si_state.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index 35fadec..4a6b615 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -3252,11 +3252,11 @@ si_make_texture_descriptor(struct si_screen *screen,
> break;
> case 8:
> num_format = V_008F14_IMG_FMASK_32_8_8;
> break;
> default:
> - assert(0);
> + unreachable("invalid nr_samples");
> }
> } else {
> switch (res->nr_samples) {
> case 2:
> data_format = V_008F14_IMG_DATA_FORMAT_FMASK8_S2_F2;
> @@ -3266,11 +3266,11 @@ si_make_texture_descriptor(struct si_screen *screen,
> break;
> case 8:
> data_format = V_008F14_IMG_DATA_FORMAT_FMASK32_S8_F8;
> break;
> default:
> - assert(0);
> + unreachable("invalid nr_samples");
> }
> num_format = V_008F14_IMG_NUM_FORMAT_UINT;
> }
>
> fmask_state[0] = va >> 8;
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list