mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 05:09:20 +02:00
refactor(sonar): make narrowing conversions explicit (cpp:S5276)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -343,7 +343,7 @@ void gl::program::init()
|
||||
{
|
||||
shader::texture_entry &e = it.second;
|
||||
GLuint loc = glGetUniformLocation(*this, it.first.c_str());
|
||||
glUniform1i(loc, e.id);
|
||||
glUniform1i(loc, static_cast<GLint>(e.id));
|
||||
}
|
||||
|
||||
glUniform1i(glGetUniformLocation(*this, "shadowmap"), gl::SHADOW_TEX);
|
||||
|
||||
2
gl/ubo.h
2
gl/ubo.h
@@ -29,7 +29,7 @@ namespace gl
|
||||
void update(const uint8_t *data, int offset, GLsizeiptr size);
|
||||
template <typename T> void update(const T &data, size_t offset = 0)
|
||||
{
|
||||
update(reinterpret_cast<const uint8_t*>(&data), offset, sizeof(data));
|
||||
update(reinterpret_cast<const uint8_t*>(&data), static_cast<int>(offset), sizeof(data));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ void gl::vao::bind()
|
||||
}
|
||||
|
||||
for (size_t i = params.size(); i < 5; i++)
|
||||
glDisableVertexAttribArray(i);
|
||||
glDisableVertexAttribArray(static_cast<GLuint>(i));
|
||||
|
||||
if (ebo)
|
||||
ebo->bind(gl::buffer::ELEMENT_ARRAY_BUFFER);
|
||||
@@ -84,6 +84,6 @@ void gl::vao::unbind()
|
||||
}
|
||||
else {
|
||||
for (size_t i = 0; i < 4; i++)
|
||||
glDisableVertexAttribArray(i);
|
||||
glDisableVertexAttribArray(static_cast<GLuint>(i));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user