[Mesa-dev] [PATCH 6/7] anv: fix warnings in release build

Grazvydas Ignotas notasas at gmail.com
Sat Apr 16 01:00:15 UTC 2016


Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings
in release build.

Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
---
I have no commit access, if this patch is ok, please someone push.

 src/intel/vulkan/anv_dump.c                     | 2 +-
 src/intel/vulkan/anv_image.c                    | 2 +-
 src/intel/vulkan/anv_nir_lower_push_constants.c | 2 +-
 src/intel/vulkan/gen7_cmd_buffer.c              | 2 +-
 src/intel/vulkan/gen8_cmd_buffer.c              | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_dump.c b/src/intel/vulkan/anv_dump.c
index b7fa28b..63ad2cd 100644
--- a/src/intel/vulkan/anv_dump.c
+++ b/src/intel/vulkan/anv_dump.c
@@ -33,7 +33,7 @@ anv_dump_image_to_ppm(struct anv_device *device,
                       unsigned array_layer, const char *filename)
 {
    VkDevice vk_device = anv_device_to_handle(device);
-   VkResult result;
+   MAYBE_UNUSED VkResult result;
 
    VkExtent2D extent = { image->extent.width, image->extent.height };
    for (unsigned i = 0; i < miplevel; i++) {
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index db10962..80a03dc 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -343,7 +343,7 @@ anv_validate_CreateImageView(VkDevice _device,
 {
    ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
    const VkImageSubresourceRange *subresource;
-   const struct anv_format *view_format_info;
+   MAYBE_UNUSED const struct anv_format *view_format_info;
 
    /* Validate structure type before dereferencing it. */
    assert(pCreateInfo);
diff --git a/src/intel/vulkan/anv_nir_lower_push_constants.c b/src/intel/vulkan/anv_nir_lower_push_constants.c
index 53cd3d7..20477b5 100644
--- a/src/intel/vulkan/anv_nir_lower_push_constants.c
+++ b/src/intel/vulkan/anv_nir_lower_push_constants.c
@@ -31,7 +31,7 @@ struct lower_push_constants_state {
 static bool
 lower_push_constants_block(nir_block *block, void *void_state)
 {
-   struct lower_push_constants_state *state = void_state;
+   MAYBE_UNUSED struct lower_push_constants_state *state = void_state;
 
    nir_foreach_instr(block, instr) {
       if (instr->type != nir_instr_type_intrinsic)
diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c
index 5130a40..e7c2649 100644
--- a/src/intel/vulkan/gen7_cmd_buffer.c
+++ b/src/intel/vulkan/gen7_cmd_buffer.c
@@ -368,7 +368,7 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
 {
    struct anv_pipeline *pipeline = cmd_buffer->state.compute_pipeline;
    const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
-   VkResult result;
+   MAYBE_UNUSED VkResult result;
 
    assert(pipeline->active_stages == VK_SHADER_STAGE_COMPUTE_BIT);
 
diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c
index 3956a58..0006b8e 100644
--- a/src/intel/vulkan/gen8_cmd_buffer.c
+++ b/src/intel/vulkan/gen8_cmd_buffer.c
@@ -436,7 +436,7 @@ genX(cmd_buffer_flush_compute_state)(struct anv_cmd_buffer *cmd_buffer)
 {
    struct anv_pipeline *pipeline = cmd_buffer->state.compute_pipeline;
    const struct brw_cs_prog_data *cs_prog_data = get_cs_prog_data(pipeline);
-   VkResult result;
+   MAYBE_UNUSED VkResult result;
 
    assert(pipeline->active_stages == VK_SHADER_STAGE_COMPUTE_BIT);
 
-- 
2.7.4



More information about the mesa-dev mailing list