From 2c2af6c751ab7edf95a61a6112eb994ede45420b Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Thu, 4 Feb 2021 13:05:59 -0700 Subject: [PATCH] Update shadergen.cpp Quiets a warning in Clang about copying variables. Actual warning text: Loop variable '[qualifiers, name]' of type 'const std::__1::pair' creates a copy from type 'const std::__1::pair' --- src/core/shadergen.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/shadergen.cpp b/src/core/shadergen.cpp index b5b778bd4..5f6d938c7 100644 --- a/src/core/shadergen.cpp +++ b/src/core/shadergen.cpp @@ -340,7 +340,7 @@ void ShaderGen::DeclareVertexEntryPoint( for (u32 i = 0; i < num_texcoord_outputs; i++) ss << " " << qualifier << "float2 v_tex" << i << ";\n"; - for (const auto [qualifiers, name] : additional_outputs) + for (const auto &[qualifiers, name] : additional_outputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << " " << qualifier_to_use << " " << name << ";\n"; @@ -357,7 +357,7 @@ void ShaderGen::DeclareVertexEntryPoint( for (u32 i = 0; i < num_texcoord_outputs; i++) ss << qualifier << "out float2 v_tex" << i << ";\n"; - for (const auto [qualifiers, name] : additional_outputs) + for (const auto &[qualifiers, name] : additional_outputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << qualifier_to_use << " out " << name << ";\n"; @@ -399,7 +399,7 @@ void ShaderGen::DeclareVertexEntryPoint( ss << " " << qualifier << "out float2 v_tex" << i << " : TEXCOORD" << i << ",\n"; u32 additional_counter = num_texcoord_outputs; - for (const auto [qualifiers, name] : additional_outputs) + for (const auto &[qualifiers, name] : additional_outputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << " " << qualifier_to_use << " out " << name << " : TEXCOORD" << additional_counter << ",\n"; @@ -433,7 +433,7 @@ void ShaderGen::DeclareFragmentEntryPoint( for (u32 i = 0; i < num_texcoord_inputs; i++) ss << " " << qualifier << "float2 v_tex" << i << ";\n"; - for (const auto [qualifiers, name] : additional_inputs) + for (const auto &[qualifiers, name] : additional_inputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << " " << qualifier_to_use << " " << name << ";\n"; @@ -450,7 +450,7 @@ void ShaderGen::DeclareFragmentEntryPoint( for (u32 i = 0; i < num_texcoord_inputs; i++) ss << qualifier << "in float2 v_tex" << i << ";\n"; - for (const auto [qualifiers, name] : additional_inputs) + for (const auto &[qualifiers, name] : additional_inputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << qualifier_to_use << " in " << name << ";\n"; @@ -503,7 +503,7 @@ void ShaderGen::DeclareFragmentEntryPoint( ss << " " << qualifier << "in float2 v_tex" << i << " : TEXCOORD" << i << ",\n"; u32 additional_counter = num_texcoord_inputs; - for (const auto [qualifiers, name] : additional_inputs) + for (const auto &[qualifiers, name] : additional_inputs) { const char* qualifier_to_use = (std::strlen(qualifiers) > 0) ? qualifiers : qualifier; ss << " " << qualifier_to_use << " in " << name << " : TEXCOORD" << additional_counter << ",\n";