diff options
author | Kevin Gilbert kegilbert <kevin.gilbert@ni.com> | 2016-09-09 16:21:11 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-09-09 17:34:21 -0700 |
commit | 23cd2754e816f055accf3c3c049476a6668c52a1 (patch) | |
tree | 2094e4e05af40099ba9a3804518bc9c5e640168f /host/include | |
parent | 23198a9092fccbd29336073947db0a4d9aad098d (diff) | |
download | uhd-23cd2754e816f055accf3c3c049476a6668c52a1.tar.gz uhd-23cd2754e816f055accf3c3c049476a6668c52a1.tar.bz2 uhd-23cd2754e816f055accf3c3c049476a6668c52a1.zip |
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.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/utils/soft_register.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<typename data_t> - 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<data_t>(1); //Behavior for the left shift operation is undefined in C++ //if the shift amount is >= bitwidth of the datatype |