diff options
author | David Robillard <d@drobilla.net> | 2020-11-27 17:57:49 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-27 21:42:51 +0100 |
commit | 5cdc8bd8da6b7a6b1990ed2d7be483e19f9d7837 (patch) | |
tree | 7942e9a36ce1d13f861c5dc190928bc4fb416e25 /src | |
parent | 5a07dbc89f1459c57b44e10248669a94e7881525 (diff) | |
download | patchage-5cdc8bd8da6b7a6b1990ed2d7be483e19f9d7837.tar.gz patchage-5cdc8bd8da6b7a6b1990ed2d7be483e19f9d7837.tar.bz2 patchage-5cdc8bd8da6b7a6b1990ed2d7be483e19f9d7837.zip |
Use C++ casts
Unfortunately, the warning needs to stay on because of Gtk and ALSA.
Diffstat (limited to 'src')
-rw-r--r-- | src/AlsaDriver.cpp | 2 | ||||
-rw-r--r-- | src/Patchage.cpp | 8 | ||||
-rw-r--r-- | src/PatchageCanvas.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index 6b832eb..55a95df 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -516,7 +516,7 @@ AlsaDriver::create_refresh_port() void* AlsaDriver::refresh_main(void* me) { - auto* ad = (AlsaDriver*)me; + auto* ad = static_cast<AlsaDriver*>(me); ad->_refresh_main(); return nullptr; } diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 13011b1..b8f55cd 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -80,7 +80,7 @@ terminate_cb(GtkosxApplication* app, gpointer data) static bool configure_cb(GtkWindow* parentWindow, GdkEvent* event, gpointer data) { - ((Patchage*)data)->store_window_location(); + static_cast<Patchage*>(data)->store_window_location(); return FALSE; } @@ -821,7 +821,7 @@ Patchage::on_help_about() static void update_labels(GanvNode* node, void* data) { - const bool human_names = *(const bool*)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<PatchageModule*>(gmod); @@ -921,7 +921,7 @@ highlight_color(guint c, guint delta) static void update_port_colors(GanvNode* node, void* data) { - auto* patchage = (Patchage*)data; + auto* patchage = static_cast<Patchage*>(data); if (!GANV_IS_MODULE(node)) { return; } @@ -946,7 +946,7 @@ update_port_colors(GanvNode* node, void* data) static void update_edge_color(GanvEdge* edge, void* data) { - auto* patchage = (Patchage*)data; + auto* patchage = static_cast<Patchage*>(data); Ganv::Edge* edgemm = Glib::wrap(edge); auto* tail = dynamic_cast<PatchagePort*>((edgemm)->get_tail()); diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index 1dfe9e0..e081acb 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -147,7 +147,7 @@ struct RemovePortsData static void delete_port_if_matches(GanvPort* port, void* cdata) { - auto* data = (RemovePortsData*)cdata; + auto* data = static_cast<RemovePortsData*>(cdata); auto* pport = dynamic_cast<PatchagePort*>(Glib::wrap(port)); if (pport && data->pred(pport)) { delete pport; @@ -167,7 +167,7 @@ remove_ports_matching(GanvNode* node, void* cdata) return; } - auto* data = (RemovePortsData*)cdata; + auto* data = static_cast<RemovePortsData*>(cdata); pmodule->for_each_port(delete_port_if_matches, data); @@ -310,7 +310,7 @@ PatchageCanvas::add_module(const std::string& name, PatchageModule* module) static void disconnect_edge(GanvEdge* edge, void* data) { - auto* canvas = (PatchageCanvas*)data; + auto* canvas = static_cast<PatchageCanvas*>(data); Ganv::Edge* edgemm = Glib::wrap(edge); canvas->disconnect(edgemm->get_tail(), edgemm->get_head()); } |