summaryrefslogtreecommitdiffstats
path: root/src/server/JackDriver.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/JackDriver.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/JackDriver.cpp')
-rw-r--r--src/server/JackDriver.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index d991879e..0589a021 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -52,6 +52,7 @@
#include <cassert>
#include <chrono>
+#include <cstdint>
#include <map>
#include <string>
#include <utility>
@@ -109,7 +110,8 @@ JackDriver::attach(const std::string& server_name,
_sample_rate = jack_get_sample_rate(_client);
_block_length = jack_get_buffer_size(_client);
- _seq_size = jack_port_type_get_buffer_size(_client, JACK_DEFAULT_MIDI_TYPE);
+ _seq_size = static_cast<uint32_t>(
+ jack_port_type_get_buffer_size(_client, JACK_DEFAULT_MIDI_TYPE));
_fallback_buffer = AudioBufPtr(
static_cast<float*>(
@@ -522,7 +524,8 @@ JackDriver::_block_length_cb(jack_nframes_t nframes)
{
if (_engine.root_graph()) {
_block_length = nframes;
- _seq_size = jack_port_type_get_buffer_size(_client, JACK_DEFAULT_MIDI_TYPE);
+ _seq_size = static_cast<uint32_t>(
+ jack_port_type_get_buffer_size(_client, JACK_DEFAULT_MIDI_TYPE));
_engine.root_graph()->set_buffer_size(
_engine.run_context(), *_engine.buffer_factory(), PortType::AUDIO,
_engine.buffer_factory()->audio_buffer_size(nframes));