From 13ccc20463093d47ecb0f9562d63414ec0d7287c Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Thu, 12 May 2022 20:11:12 +0200 Subject: rfnoc: fix double conversions result of get double was saved in an int value instead of double replaced C cast by static_cast --- host/lib/rfnoc/rfnoc_python.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/rfnoc_python.hpp b/host/lib/rfnoc/rfnoc_python.hpp index cd40afebd..d041ee99e 100644 --- a/host/lib/rfnoc/rfnoc_python.hpp +++ b/host/lib/rfnoc/rfnoc_python.hpp @@ -510,12 +510,11 @@ void export_rfnoc(py::module& m) [](noc_block_base& self, const std::string& id, const size_t instance) -> double { // Try both float types try { - int value = self.get_property(id, instance); - return (double)value; + return self.get_property(id, instance); } catch(const uhd::type_error&) { try { - size_t value = self.get_property(id, instance); - return (double)value; + float value = self.get_property(id, instance); + return static_cast(value); } catch(...) { throw; } -- cgit v1.2.3