[Mesa-dev] [PATCH 3/4] vulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Aug 17 14:46:17 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

for this patch.

On Fri, Aug 17, 2018 at 4:32 PM, Kai Wasserbäch
<kai at dev.carbon-project.org> wrote:
> Supresses a maybe-uninitialized warning with GCC 8.
>
> Note: image_index should always be initialised due to the result check,
>       but the compiler doesn't see that.
> Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
> ---
>  src/vulkan/wsi/wsi_common_x11.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
> index 7e7b3a94e4..7b930884b4 100644
> --- a/src/vulkan/wsi/wsi_common_x11.c
> +++ b/src/vulkan/wsi/wsi_common_x11.c
> @@ -991,7 +991,7 @@ x11_manage_fifo_queues(void *state)
>         * before that point so the client should be able to acquire any image
>         * other than the currently presented one.
>         */
> -      uint32_t image_index;
> +      uint32_t image_index = 0;
>        result = wsi_queue_pull(&chain->present_queue, &image_index, INT64_MAX);
>        assert(result != VK_TIMEOUT);
>        if (result < 0) {
> --
> 2.18.0
>
> _______________________________________________
> 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