From 54b41565a072a7c62270773d3c2193b7ac5cf327 Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Mon, 16 Mar 2026 18:08:53 -0400 Subject: [PATCH] nvk: Rename macro loop index from i to _index Calling this varaible `i` made it very easy for it to shadow a loop variable in the enclosing scope, which became an issue if `src` were an expression referencing a different variable `i`. Rename the variable to make shadowing less likely. Reviewed-by: Mary Guillemard Part-of: --- src/nouveau/vulkan/nvk_cmd_buffer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nouveau/vulkan/nvk_cmd_buffer.h b/src/nouveau/vulkan/nvk_cmd_buffer.h index a243b404416..194d3fe905d 100644 --- a/src/nouveau/vulkan/nvk_cmd_buffer.h +++ b/src/nouveau/vulkan/nvk_cmd_buffer.h @@ -110,8 +110,8 @@ struct nvk_descriptor_state { unsigned _start = start; \ unsigned _count = count; \ assert(_start + _count <= ARRAY_SIZE(root->member)); \ - for (unsigned i = 0; i < _count; i++) \ - (dst)[i] = root->member[i + _start]; \ + for (unsigned _index = 0; _index < _count; _index++) \ + (dst)[_index] = root->member[_index + _start]; \ } while (0) #define nvk_descriptor_state_set_root(cmd, desc, member, src) do { \ @@ -133,8 +133,8 @@ struct nvk_descriptor_state { unsigned _start = start; \ unsigned _count = count; \ assert(_start + _count <= ARRAY_SIZE(root->member)); \ - for (unsigned i = 0; i < _count; i++) \ - root->member[i + _start] = (src)[i]; \ + for (unsigned _index = 0; _index < _count; _index++) \ + root->member[_index + _start] = (src)[_index]; \ if (_desc->flush_root != NULL) { \ size_t offset = (char *)&root->member[_start] - (char *)root; \ _desc->flush_root((cmd), _desc, offset, \