summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 15:20:45 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit4ef41be9596cf997cd80175cfc7de2074a182d0d (patch)
tree33388d991953b7d1fae5a953e0fa08b545e99a41 /src/client
parentdbb38be5ccda387ef458583b5a85c03b59a5e05c (diff)
downloadingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.tar.gz
ingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.tar.bz2
ingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.zip
Use auto with casts and allocations to remove redundancy
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PluginUI.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 6fdf76c5..9c759696 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -52,7 +52,7 @@ lv2_ui_write(SuilController controller,
uint32_t format,
const void* buffer)
{
- PluginUI* const ui = static_cast<PluginUI*>(controller);
+ auto* const ui = static_cast<PluginUI*>(controller);
const URIs& uris = ui->world().uris();
SPtr<const PortModel> port = get_port(ui, port_index);
if (!port) {
@@ -80,9 +80,10 @@ lv2_ui_write(SuilController controller,
Resource::Graph::DEFAULT);
} else if (format == uris.atom_eventTransfer.urid()) {
- const LV2_Atom* atom = static_cast<const LV2_Atom*>(buffer);
- Atom val = ui->world().forge().alloc(
- atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
+ const auto* atom = static_cast<const LV2_Atom*>(buffer);
+ Atom val = ui->world().forge().alloc(atom->size,
+ atom->type,
+ LV2_ATOM_BODY_CONST(atom));
ui->signal_property_changed()(port->uri(),
uris.ingen_activity,
val,
@@ -97,7 +98,7 @@ lv2_ui_write(SuilController controller,
static uint32_t
lv2_ui_port_index(SuilController controller, const char* port_symbol)
{
- PluginUI* const ui = static_cast<PluginUI*>(controller);
+ auto* const ui = static_cast<PluginUI*>(controller);
const BlockModel::Ports& ports = ui->block()->ports();
for (uint32_t i = 0; i < ports.size(); ++i) {
@@ -114,7 +115,7 @@ lv2_ui_subscribe(SuilController controller,
uint32_t protocol,
const LV2_Feature* const* features)
{
- PluginUI* const ui = static_cast<PluginUI*>(controller);
+ auto* const ui = static_cast<PluginUI*>(controller);
SPtr<const PortModel> port = get_port(ui, port_index);
if (!port) {
return 1;
@@ -135,7 +136,7 @@ lv2_ui_unsubscribe(SuilController controller,
uint32_t protocol,
const LV2_Feature* const* features)
{
- PluginUI* const ui = static_cast<PluginUI*>(controller);
+ auto* const ui = static_cast<PluginUI*>(controller);
SPtr<const PortModel> port = get_port(ui, port_index);
if (!port) {
return 1;