From a58a86c262164945a3de2724dab50c6a4cc54241 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 19 Jul 2022 09:55:24 -0400 Subject: Use strict casts --- src/Patchage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 29f6ecc..e74b812 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -417,7 +417,8 @@ Patchage::update_toolbar() const auto buffer_size = _drivers.jack()->buffer_size(); const auto sample_rate = _drivers.jack()->sample_rate(); if (sample_rate != 0) { - const auto latency_ms = buffer_size * 1000 / float(sample_rate); + const auto latency_ms = + buffer_size * 1000 / static_cast(sample_rate); _latency_label->set_label(fmt::format( " frames @ {} kHz ({:0.2f} ms)", sample_rate / 1000, latency_ms)); @@ -463,8 +464,11 @@ Patchage::store_window_location() int size_y = 0; _main_win->get_size(size_x, size_y); - _conf.set({double(loc_x), double(loc_y)}); - _conf.set({double(size_x), double(size_y)}); + _conf.set( + {static_cast(loc_x), static_cast(loc_y)}); + + _conf.set( + {static_cast(size_x), static_cast(size_y)}); } void -- cgit v1.2.1