mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 05:09:20 +02:00
refactor(sonar): declare non-mutating member functions const (cpp:S5817)
Virtual functions are left untouched so overrides keep matching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -225,7 +225,7 @@ void render_task::run()
|
||||
}
|
||||
}
|
||||
|
||||
void render_task::upload()
|
||||
void render_task::upload() const
|
||||
{
|
||||
if (Global.python_uploadmain && m_target && m_target->shared_tex)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ void render_task::upload()
|
||||
}
|
||||
}
|
||||
|
||||
void render_task::cancel() {}
|
||||
void render_task::cancel() const {}
|
||||
|
||||
// initializes the module. returns true on success
|
||||
auto python_taskqueue::init() -> bool
|
||||
@@ -465,7 +465,7 @@ void python_taskqueue::acquire_lock()
|
||||
}
|
||||
|
||||
// releases the python gil and swaps the main thread out
|
||||
void python_taskqueue::release_lock()
|
||||
void python_taskqueue::release_lock() const
|
||||
{
|
||||
|
||||
PyEval_SaveThread();
|
||||
|
||||
@@ -80,8 +80,8 @@ class render_task
|
||||
render_task(PyObject *Renderer, std::shared_ptr<dictionary_source> Input, std::shared_ptr<python_rt> Target) : m_renderer(Renderer), m_input(Input), m_target(Target) {}
|
||||
// methods
|
||||
void run();
|
||||
void upload();
|
||||
void cancel();
|
||||
void upload() const;
|
||||
void cancel() const;
|
||||
auto target() const -> std::shared_ptr<python_rt>
|
||||
{
|
||||
return m_target;
|
||||
@@ -120,7 +120,7 @@ class python_taskqueue
|
||||
// acquires the python gil and sets the main thread as current
|
||||
void acquire_lock();
|
||||
// releases the python gil and swaps the main thread out
|
||||
void release_lock();
|
||||
void release_lock() const;
|
||||
|
||||
void update();
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ void python_screen_viewer::threadfunc()
|
||||
}
|
||||
}
|
||||
|
||||
void python_screen_viewer::notify_window_fb_size(GLFWwindow *window, int w, int h)
|
||||
void python_screen_viewer::notify_window_fb_size(GLFWwindow *window, int w, int h) const
|
||||
{
|
||||
for (auto &conf : m_windows) {
|
||||
if (conf->window == window) {
|
||||
@@ -200,7 +200,7 @@ void python_screen_viewer::notify_window_fb_size(GLFWwindow *window, int w, int
|
||||
}
|
||||
}
|
||||
|
||||
void python_screen_viewer::notify_window_size(GLFWwindow *window, int w, int h)
|
||||
void python_screen_viewer::notify_window_size(GLFWwindow *window, int w, int h) const
|
||||
{
|
||||
for (auto &conf : m_windows) {
|
||||
if (conf->window == window) {
|
||||
@@ -211,7 +211,7 @@ void python_screen_viewer::notify_window_size(GLFWwindow *window, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
void python_screen_viewer::notify_cursor_pos(GLFWwindow *window, double x, double y)
|
||||
void python_screen_viewer::notify_cursor_pos(GLFWwindow *window, double x, double y) const
|
||||
{
|
||||
for (auto &conf : m_windows) {
|
||||
if (conf->window == window) {
|
||||
@@ -222,7 +222,7 @@ void python_screen_viewer::notify_cursor_pos(GLFWwindow *window, double x, doubl
|
||||
}
|
||||
}
|
||||
|
||||
void python_screen_viewer::notify_click(GLFWwindow *window, int button, int action)
|
||||
void python_screen_viewer::notify_click(GLFWwindow *window, int button, int action) const
|
||||
{
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT || action != GLFW_PRESS)
|
||||
return;
|
||||
|
||||
@@ -38,8 +38,8 @@ public:
|
||||
python_screen_viewer(std::shared_ptr<python_rt> rt, std::shared_ptr<std::vector<glm::vec2>> touchlist, std::string name);
|
||||
~python_screen_viewer();
|
||||
|
||||
void notify_window_size(GLFWwindow *window, int w, int h);
|
||||
void notify_window_fb_size(GLFWwindow *window, int w, int h);
|
||||
void notify_cursor_pos(GLFWwindow *window, double x, double y);
|
||||
void notify_click(GLFWwindow *window, int button, int action);
|
||||
void notify_window_size(GLFWwindow *window, int w, int h) const;
|
||||
void notify_window_fb_size(GLFWwindow *window, int w, int h) const;
|
||||
void notify_cursor_pos(GLFWwindow *window, double x, double y) const;
|
||||
void notify_click(GLFWwindow *window, int button, int action) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user