summaryrefslogtreecommitdiffstats
path: root/src/server/ingen_lv2.cpp
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/server/ingen_lv2.cpp
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/server/ingen_lv2.cpp')
-rw-r--r--src/server/ingen_lv2.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index d474693d..f5b4e79f 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -113,7 +113,7 @@ class LV2Driver : public Driver, public ingen::AtomSink
public:
LV2Driver(Engine& engine,
SampleCount block_length,
- size_t seq_size,
+ uint32_t seq_size,
SampleCount sample_rate)
: _engine(engine)
, _main_sem(0)
@@ -388,7 +388,7 @@ public:
}
SampleCount block_length() const override { return _block_length; }
- size_t seq_size() const override { return _seq_size; }
+ uint32_t seq_size() const override { return _seq_size; }
SampleCount sample_rate() const override { return _sample_rate; }
SampleCount frame_time() const override { return _frame_time; }
@@ -412,7 +412,7 @@ private:
GraphImpl* _root_graph{nullptr};
uint32_t _notify_capacity{0};
SampleCount _block_length;
- size_t _seq_size;
+ uint32_t _seq_size;
SampleCount _sample_rate;
SampleCount _frame_time{0};
raul::Semaphore _to_ui_overflow_sem{0};
@@ -552,7 +552,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
block_length = 4096;
plugin->world->log().warn("No maximum block length given\n");
}
- if (seq_size == 0) {
+ if (seq_size < 1) {
seq_size = 16384;
plugin->world->log().warn("No maximum sequence size given\n");
}
@@ -575,7 +575,8 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
ThreadManager::set_flag(THREAD_PRE_PROCESS);
ThreadManager::single_threaded = true;
- auto* driver = new LV2Driver(*engine, block_length, seq_size, rate);
+ auto* driver = new LV2Driver(
+ *engine, block_length, static_cast<uint32_t>(seq_size), rate);
engine->set_driver(std::shared_ptr<Driver>(driver));
engine->activate();