Mesa (master): vulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Aug 18 00:35:17 UTC 2018
Module: Mesa
Branch: master
Commit: 2c020dbf063b55d96b1e799fb8dd6ec335b84c33
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c020dbf063b55d96b1e799fb8dd6ec335b84c33
Author: Kai Wasserbäch <kai at dev.carbon-project.org>
Date: Fri Aug 17 16:32:33 2018 +0200
vulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues
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>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
---
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) {
More information about the mesa-commit
mailing list