Mesa (master): intel/decoder: mark total_length as MAYBE_UNUSED in gen_spec_load
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 20 10:09:17 UTC 2018
Module: Mesa
Branch: master
Commit: 5fab32ddad8b32c4a05517c43623653f8634c4d9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fab32ddad8b32c4a05517c43623653f8634c4d9
Author: Kai Wasserbäch <kai at dev.carbon-project.org>
Date: Sat Aug 18 13:16:15 2018 +0200
intel/decoder: mark total_length as MAYBE_UNUSED in gen_spec_load
Only used, when asserts are enabled.
Fixes an unused-variable warning with GCC 8:
../../../src/intel/common/gen_decoder.c: In function 'gen_spec_load':
../../../src/intel/common/gen_decoder.c:535:47: warning: variable 'total_length' set but not used [-Wunused-but-set-variable]
uint32_t text_offset = 0, text_length = 0, total_length;
^~~~~~~~~~~~
Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
src/intel/common/gen_decoder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index ec0a486b10..c14c23aad1 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -532,7 +532,8 @@ gen_spec_load(const struct gen_device_info *devinfo)
struct parser_context ctx;
void *buf;
uint8_t *text_data = NULL;
- uint32_t text_offset = 0, text_length = 0, total_length;
+ uint32_t text_offset = 0, text_length = 0;
+ MAYBE_UNUSED uint32_t total_length;
uint32_t gen_10 = devinfo_to_gen(devinfo);
for (int i = 0; i < ARRAY_SIZE(genxml_files_table); i++) {
More information about the mesa-commit
mailing list