17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 17:50:29 +01:00

refactor(sonar): use std::array for local fixed-size arrays (cpp:S5945)

Arrays that are class members or part of headers are left unchanged.
This commit is contained in:
jerrrrycho
2026-10-10 17:44:14 +02:00
parent 7a27af5a47
commit a322472632
12 changed files with 74 additions and 74 deletions

View File

@@ -318,11 +318,11 @@ gl::shader::shader(const std::string &filename) : name(filename)
glGetShaderiv(*this, GL_COMPILE_STATUS, &status);
if (!status)
{
GLchar info[512];
glGetShaderInfoLog(*this, 512, nullptr, info);
log_error(std::string(info));
std::array<GLchar, 512> info{};
glGetShaderInfoLog(*this, static_cast<GLsizei>(info.size()), nullptr, info.data());
log_error(std::string(info.data()));
throw shader_exception("failed to compile " + filename + ": " + std::string(info));
throw shader_exception("failed to compile " + filename + ": " + std::string(info.data()));
}
}
@@ -392,9 +392,9 @@ void gl::program::link()
glGetProgramiv(*this, GL_LINK_STATUS, &status);
if (!status)
{
GLchar info[512];
glGetProgramInfoLog(*this, 512, nullptr, info);
throw shader_exception("failed to link program: " + std::string(info));
std::array<GLchar, 512> info{};
glGetProgramInfoLog(*this, static_cast<GLsizei>(info.size()), nullptr, info.data());
throw shader_exception("failed to link program: " + std::string(info.data()));
}
init();