vulkan/wsi: initialise image_index to 0 in x11_manage_fifo_queues
authorKai Wasserbäch <kai@dev.carbon-project.org>
Fri, 17 Aug 2018 14:32:33 +0000 (16:32 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 18 Aug 2018 00:34:19 +0000 (10:34 +1000)
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@dev.carbon-project.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/vulkan/wsi/wsi_common_x11.c

index 7e7b3a94e4bb04bac6130fa83a81836150ccf683..7b930884b4709d7c6dc4211a85ff249855ff797f 100644 (file)
@@ -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) {