From 23cd2754e816f055accf3c3c049476a6668c52a1 Mon Sep 17 00:00:00 2001 From: Kevin Gilbert kegilbert Date: Fri, 9 Sep 2016 16:21:11 -0700 Subject: soft_regs: Fixed 32-bit issue Softregs didn't properly work on 32-bit systems. This changed the 'mask' inline function to return template date type rather than size_t to avoid truncation of data during shift of 64-bit data in 32-bit applications. --- host/include/uhd/utils/soft_register.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/include/uhd/utils/soft_register.hpp b/host/include/uhd/utils/soft_register.hpp index 09a69fce2..22c3a0ff0 100644 --- a/host/include/uhd/utils/soft_register.hpp +++ b/host/include/uhd/utils/soft_register.hpp @@ -95,7 +95,7 @@ namespace soft_reg_field { } template - UHD_INLINE size_t mask(const soft_reg_field_t field) { + UHD_INLINE data_t mask(const soft_reg_field_t field) { static const data_t ONE = static_cast(1); //Behavior for the left shift operation is undefined in C++ //if the shift amount is >= bitwidth of the datatype -- cgit v1.2.3