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

refactor(sonar): pass expensive-to-copy parameters by const reference (cpp:S1238)

Signatures declared in files touched by PR 206 (Driver.h, EU07.cpp) and
virtual overrides are left unchanged.
This commit is contained in:
jerrrrycho
2026-10-10 17:16:40 +02:00
parent 4532d5e037
commit f6736fa233
26 changed files with 42 additions and 42 deletions

View File

@@ -470,7 +470,7 @@ void python_taskqueue::release_lock() const
PyEval_SaveThread();
}
auto python_taskqueue::fetch_renderer(std::string const Renderer) -> PyObject *
auto python_taskqueue::fetch_renderer(std::string const &Renderer) -> PyObject *
{
if (auto const lookup{m_renderers.find(Renderer)}; lookup != std::end(m_renderers))

View File

@@ -131,7 +131,7 @@ class python_taskqueue
using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
// methods
auto fetch_renderer(std::string const Renderer) -> PyObject *;
auto fetch_renderer(std::string const &Renderer) -> PyObject *;
void run(GLFWwindow *Context, rendertask_sequence &Tasks, uploadtask_sequence &Upload_Tasks, threading::condition_variable &Condition, std::atomic<bool> const &Exit);
void error();

View File

@@ -164,7 +164,7 @@ basic_controller::deserialize_operation( cParser &Input ) -> bool {
}
auto
basic_controller::insert( std::string const Name, basic_element Element ) -> element_handle {
basic_controller::insert( std::string const &Name, basic_element Element ) -> element_handle {
m_elements.push_back( Element );
m_elementnames.push_back( Name );

View File

@@ -100,7 +100,7 @@ private:
// methods
auto deserialize_operation( cParser &Input ) -> bool;
// adds provided item to the collection. returns: true if there's no duplicate with the same name, false otherwise
auto insert( std::string const Name, basic_element Element ) -> element_handle;
auto insert( std::string const &Name, basic_element Element ) -> element_handle;
// runs one cycle of current program. returns: error code or 0 if there's no error
auto run() -> int;
void log_error( std::string const &Error, int const Line = -1 ) const;

View File

@@ -29,7 +29,7 @@ void texture_window_cursor_pos(GLFWwindow *win, double x, double y)
texwindow->notify_cursor_pos(win, x, y);
}
python_screen_viewer::python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string surfacename)
python_screen_viewer::python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string const &surfacename)
: m_rt(rt), m_touchlist(touchlist)
{

View File

@@ -35,7 +35,7 @@ class python_screen_viewer
void threadfunc();
public:
python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string name);
python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string const &name);
~python_screen_viewer();
void notify_window_size(GLFWwindow const *window, int w, int h) const;