mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-28 20:27:28 +01:00
refactor(sonar): make narrowing conversions explicit (cpp:S5276)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -141,7 +141,7 @@ basic_controller::deserialize_operation( cParser &Input ) -> bool {
|
||||
auto const lookup { m_operationcodemap.find( operationname ) };
|
||||
operation.code = lookup != m_operationcodemap.end() ? lookup->second : opcode_e::op_nop;
|
||||
if( lookup == m_operationcodemap.end() ) {
|
||||
log_error( "contains unknown command \"" + operationname + "\"", Input.Line() - 1 );
|
||||
log_error( "contains unknown command \"" + operationname + "\"", static_cast<int>(Input.Line() - 1) );
|
||||
}
|
||||
|
||||
if( operation.code == opcode_e::op_nop ) { return true; }
|
||||
|
||||
@@ -158,7 +158,7 @@ auto basic_controller::find_or_insert( std::string const &Name, basic_element::t
|
||||
auto index { 1 };
|
||||
for( auto const &name : m_elementnames ) {
|
||||
if( name == Name ) {
|
||||
return index;
|
||||
return static_cast<element_handle>(index);
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ void python_screen_viewer::threadfunc()
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
||||
if (Global.python_sharectx) {
|
||||
glBindTexture(GL_TEXTURE_2D, m_rt->shared_tex->get_id());
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<GLuint>(m_rt->shared_tex->get_id()));
|
||||
}
|
||||
else {
|
||||
GLuint tex;
|
||||
@@ -215,8 +215,8 @@ void python_screen_viewer::notify_cursor_pos(GLFWwindow *window, double x, doubl
|
||||
{
|
||||
for (auto &conf : m_windows) {
|
||||
if (conf->window == window) {
|
||||
conf->cursor_pos.x = x;
|
||||
conf->cursor_pos.y = y;
|
||||
conf->cursor_pos.x = static_cast<int>(x);
|
||||
conf->cursor_pos.y = static_cast<int>(y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user