From 055d305ffe1eb9375e917708faf968e65751ab82 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Dec 2022 17:47:56 -0500 Subject: Avoid implicit conversions --- src/Configuration.cpp | 2 +- src/client/BlockModel.cpp | 10 ++++++---- 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(_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(srate); + min *= frate; + max *= frate; } } @@ -232,8 +233,9 @@ BlockModel::port_value_range(const std::shared_ptr& port, } if (port->port_property(_uris.lv2_sampleRate)) { - min *= srate; - max *= srate; + const auto frate = static_cast(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(), - (t_end - t_start) / 1000000.0, + static_cast(t_end - t_start) / 1000000.0, (n_test_frames / 48000.0)); // Shut down -- cgit v1.2.1