summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-07-17 11:33:25 -0400
committerDavid Robillard <d@drobilla.net>2024-07-17 12:30:47 -0400
commit175c04323ad1aaaa1e0c949b8de411d5e2cece74 (patch)
treeac359693858f9ba2e619f2d9fc9b809af637a82e /src/gui
parent973db12fe33bab8e6efca80deca358b4998d5eb2 (diff)
downloadingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.tar.gz
ingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.tar.bz2
ingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.zip
Avoid C-style casts and some size type conversions
Aside from the syntactic cast changes, reduces some size types to 32-bits, since they can never be so large in practice. This eliminates some type conversions and shaves a few bytes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/.clang-tidy1
-rw-r--r--src/gui/ConnectWindow.cpp2
-rw-r--r--src/gui/GraphBox.cpp2
-rw-r--r--src/gui/GraphCanvas.cpp2
-rw-r--r--src/gui/NewSubgraphWindow.cpp2
-rw-r--r--src/gui/Port.cpp2
6 files changed, 5 insertions, 6 deletions
diff --git a/src/gui/.clang-tidy b/src/gui/.clang-tidy
index 4dc4facc..99bd2aba 100644
--- a/src/gui/.clang-tidy
+++ b/src/gui/.clang-tidy
@@ -15,7 +15,6 @@ Checks: >
-clang-analyzer-core.CallAndMessage,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-bounds-constant-array-index,
- -cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-slicing,
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 82447888..f645bb30 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -111,7 +111,7 @@ ConnectWindow::start(App& app, ingen::World& world)
}
set_connected_to(world.interface());
- connect(bool(world.interface()));
+ connect(!!world.interface());
}
void
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 2de4fa33..e4a95bed 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -390,7 +390,7 @@ GraphBox::set_graph(const std::shared_ptr<const GraphModel>& graph,
}
}
- _menu_parent->property_sensitive() = bool(graph->parent());
+ _menu_parent->property_sensitive() = !!graph->parent();
new_port_connection = graph->signal_new_port().connect(
sigc::mem_fun(this, &GraphBox::graph_port_added));
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 5ea39de0..e02c4e5b 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -876,7 +876,7 @@ GraphCanvas::menu_add_port(const string& sym_base,
uris.rdf_type,
Property(is_output ? uris.lv2_OutputPort : uris.lv2_InputPort));
props.emplace(uris.lv2_index,
- _app.forge().make(int32_t(_graph->num_ports())));
+ _app.forge().make(static_cast<int32_t>(_graph->num_ports())));
props.emplace(uris.lv2_name, _app.forge().alloc(name.c_str()));
_app.interface()->put(path_to_uri(path), props);
}
diff --git a/src/gui/NewSubgraphWindow.cpp b/src/gui/NewSubgraphWindow.cpp
index 9ccb6904..28a5afa7 100644
--- a/src/gui/NewSubgraphWindow.cpp
+++ b/src/gui/NewSubgraphWindow.cpp
@@ -118,7 +118,7 @@ NewSubgraphWindow::ok_clicked()
// Create graph
Properties props;
props.emplace(_app->uris().rdf_type, Property(_app->uris().ingen_Graph));
- props.emplace(_app->uris().ingen_polyphony, _app->forge().make(int32_t(poly)));
+ props.emplace(_app->uris().ingen_polyphony, _app->forge().make(static_cast<int32_t>(poly)));
props.emplace(_app->uris().ingen_enabled, _app->forge().make(true));
_app->interface()->put(
path_to_uri(path), props, Resource::Graph::INTERNAL);
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 36e03c5c..3925ed0c 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -230,7 +230,7 @@ Port::on_value_changed(double value)
return; // No change
}
- const Atom atom = _app.forge().make(float(value));
+ const Atom atom = _app.forge().make(static_cast<float>(value));
_app.set_property(model()->uri(),
_app.world().uris().ingen_value,
atom);