17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 17:59:19 +02:00

refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 15:44:18 +02:00
parent f8104bd0dd
commit 9b89a5d887
27 changed files with 78 additions and 175 deletions

View File

@@ -154,8 +154,7 @@ std::pair<GLuint, std::string> gl::shader::process_source(const std::string &fil
// the driver advertises support (see desktop comment above).
// (Glad config doesn't generate GLAD_GL_EXT_gpu_shader5 -- query
// the live extension string the same way.)
static bool const have_gpu_shader5 = has_gl_extension("GL_EXT_gpu_shader5");
if (have_gpu_shader5)
if (static bool const have_gpu_shader5 = has_gl_extension("GL_EXT_gpu_shader5"); have_gpu_shader5)
str += "#extension GL_EXT_gpu_shader5 : enable\n";
if (type == GL_GEOMETRY_SHADER)
str += "#extension GL_EXT_geometry_shader : require\n";