diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Configuration.hpp | 3 | ||||
-rw-r--r-- | src/Patchage.cpp | 10 | ||||
-rw-r--r-- | src/Reactor.cpp | 4 | ||||
-rw-r--r-- | src/handle_event.cpp | 2 |
4 files changed, 8 insertions, 11 deletions
diff --git a/src/Configuration.hpp b/src/Configuration.hpp index d956bd8..ffaee6e 100644 --- a/src/Configuration.hpp +++ b/src/Configuration.hpp @@ -74,8 +74,7 @@ public: // Set a global port color setting void set_setting(setting::PortColor new_setting) { - auto& color = _port_colors[static_cast<unsigned>(new_setting.type)]; - + const auto& color = _port_colors[static_cast<unsigned>(new_setting.type)]; if (color != new_setting.color) { set_port_color(new_setting.type, new_setting.color); } diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 718200a..54f81f0 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -171,8 +171,7 @@ update_labels(GanvNode* node, void* data) const bool human_names = *static_cast<const bool*>(data); if (GANV_IS_MODULE(node)) { Ganv::Module* gmod = Glib::wrap(GANV_MODULE(node)); - auto* pmod = dynamic_cast<CanvasModule*>(gmod); - if (pmod) { + if (dynamic_cast<const CanvasModule*>(gmod)) { for (Ganv::Port* gport : *gmod) { auto* pport = dynamic_cast<CanvasPort*>(gport); if (pport) { @@ -204,12 +203,11 @@ update_port_colors(GanvNode* node, void* data) } Ganv::Module* gmod = Glib::wrap(GANV_MODULE(node)); - auto* pmod = dynamic_cast<CanvasModule*>(gmod); - if (!pmod) { + if (!dynamic_cast<CanvasModule*>(gmod)) { return; } - for (Ganv::Port* p : *pmod) { + for (Ganv::Port* p : *gmod) { auto* port = dynamic_cast<CanvasPort*>(p); if (port) { const uint32_t rgba = patchage->conf().get_port_color(port->type()); @@ -226,7 +224,7 @@ update_edge_color(GanvEdge* edge, void* data) Ganv::Edge* edgemm = Glib::wrap(edge); if (edgemm) { - auto* tail = dynamic_cast<CanvasPort*>((edgemm)->get_tail()); + const auto* tail = dynamic_cast<const CanvasPort*>((edgemm)->get_tail()); if (tail) { edgemm->set_color(patchage->conf().get_port_color(tail->type())); } diff --git a/src/Reactor.cpp b/src/Reactor.cpp index 7163539..8bb89d3 100644 --- a/src/Reactor.cpp +++ b/src/Reactor.cpp @@ -191,11 +191,11 @@ Reactor::module_name(const ClientID& client) { // Note that split modules always have the same name - if (CanvasModule* mod = find_module(client, SignalDirection::input)) { + if (const CanvasModule* mod = find_module(client, SignalDirection::input)) { return mod->name(); } - if (CanvasModule* mod = find_module(client, SignalDirection::output)) { + if (const CanvasModule* mod = find_module(client, SignalDirection::output)) { return mod->name(); } diff --git a/src/handle_event.cpp b/src/handle_event.cpp index d75c42d..4564a27 100644 --- a/src/handle_event.cpp +++ b/src/handle_event.cpp @@ -79,7 +79,7 @@ public: { _metadata.set_port(event.id, event.info); - auto* const port = + const auto* const port = _canvas.create_port(_conf, _metadata, event.id, event.info); if (!port) { |