diff options
author | David Robillard <d@drobilla.net> | 2022-12-14 17:47:56 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-14 18:04:27 -0500 |
commit | 055d305ffe1eb9375e917708faf968e65751ab82 (patch) | |
tree | 8e4eda04e0fb9e49123067c564804949de7f3037 | |
parent | c57a4fd74afe56fcece6b6f5f36146c9c57e7108 (diff) | |
download | ingen-055d305ffe1eb9375e917708faf968e65751ab82.tar.gz ingen-055d305ffe1eb9375e917708faf968e65751ab82.tar.bz2 ingen-055d305ffe1eb9375e917708faf968e65751ab82.zip |
Avoid implicit conversions
-rw-r--r-- | src/Configuration.cpp | 2 | ||||
-rw-r--r-- | src/client/BlockModel.cpp | 10 | ||||
-rw-r--r-- | tests/ingen_bench.cpp | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 705594c9..aaf421cb 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -134,7 +134,7 @@ Configuration::print_usage(const std::string& program, std::ostream& os) } else { os << " "; } - os.width(_max_name_length + 11); + os.width(static_cast<std::streamsize>(_max_name_length + 11)); os << std::left; os << (std::string("--") + o.first + variable_string(option.type)); os << option.desc << std::endl; diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index 7448ca6c..998c118d 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -202,8 +202,9 @@ BlockModel::default_port_value_range( } if (port->port_property(_uris.lv2_sampleRate)) { - min *= srate; - max *= srate; + const auto frate = static_cast<float>(srate); + min *= frate; + max *= frate; } } @@ -232,8 +233,9 @@ BlockModel::port_value_range(const std::shared_ptr<const PortModel>& port, } if (port->port_property(_uris.lv2_sampleRate)) { - min *= srate; - max *= srate; + const auto frate = static_cast<float>(srate); + min *= frate; + max *= frate; } } diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp index 369aeb2a..c7eb336c 100644 --- a/tests/ingen_bench.cpp +++ b/tests/ingen_bench.cpp @@ -134,7 +134,7 @@ run(int argc, char** argv) } fprintf(log.get(), "%u\t%f\t%f\n", world->conf().option("threads").get<int32_t>(), - (t_end - t_start) / 1000000.0, + static_cast<double>(t_end - t_start) / 1000000.0, (n_test_frames / 48000.0)); // Shut down |