aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2022-05-12 20:11:12 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2022-06-10 13:24:04 -0500
commit13ccc20463093d47ecb0f9562d63414ec0d7287c (patch)
treeff6f2a80b0e0fb72c8190532efbc508361edfbd0 /host
parent03b493c129f06147a6e59ecbade9fa02fc468b06 (diff)
downloaduhd-13ccc20463093d47ecb0f9562d63414ec0d7287c.tar.gz
uhd-13ccc20463093d47ecb0f9562d63414ec0d7287c.tar.bz2
uhd-13ccc20463093d47ecb0f9562d63414ec0d7287c.zip
rfnoc: fix double conversions
result of get double was saved in an int value instead of double replaced C cast by static_cast
Diffstat (limited to 'host')
-rw-r--r--host/lib/rfnoc/rfnoc_python.hpp7
1 files changed, 3 insertions, 4 deletions
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<double>(id, instance);
- return (double)value;
+ return self.get_property<double>(id, instance);
} catch(const uhd::type_error&) {
try {
- size_t value = self.get_property<float>(id, instance);
- return (double)value;
+ float value = self.get_property<float>(id, instance);
+ return static_cast<double>(value);
} catch(...) {
throw;
}