diff options
author | Brian Silver <bsilver@us.ibm.com> | 2015-03-13 10:50:16 -0500 |
---|---|---|
committer | Derk Rembold <rembold@de.ibm.com> | 2015-09-03 07:21:42 -0500 |
commit | 91cc641a78c379d9b6b0d5c270866429d36e6c16 (patch) | |
tree | c80adfa2988186857924da0585b2106725db7b1b /import/hwpf/fapi2/include/buffer_parameters.H | |
parent | 54281ef813168b16b41a084e4f70dbab462da2ce (diff) | |
download | talos-sbe-91cc641a78c379d9b6b0d5c270866429d36e6c16.tar.gz talos-sbe-91cc641a78c379d9b6b0d5c270866429d36e6c16.zip |
Buffer, targeting updates
Update target types for ex, l2/l3
Add variable_buffer resize
Update, fix, variable_buffer insert/extract
variable_buffer array constructor
-Wall clean up
Refactor buffer::insert, bit_lengths
Change-Id: I2bbec294f275a80c33917dc2df2f8b8220f6d8d6
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16359
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Reviewed-by: MATTHEW A. PLOETZ <maploetz@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Tested-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/20126
Tested-by: Jenkins Server
Reviewed-by: Derk Rembold <rembold@de.ibm.com>
Diffstat (limited to 'import/hwpf/fapi2/include/buffer_parameters.H')
-rw-r--r-- | import/hwpf/fapi2/include/buffer_parameters.H | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/import/hwpf/fapi2/include/buffer_parameters.H b/import/hwpf/fapi2/include/buffer_parameters.H index 3dc41b26..1ad9ba43 100644 --- a/import/hwpf/fapi2/include/buffer_parameters.H +++ b/import/hwpf/fapi2/include/buffer_parameters.H @@ -41,12 +41,17 @@ namespace fapi2 class parameterTraits { public: - enum - { - mask = T(~0), - bit_length = sizeof(T) * 8, - byte_length = sizeof(T), - }; + // Why constexpr functions? Enums are hard to do math on, and + // static const doesn't work without -O1 (or greater.) That might + // be a bug in g++ but this works just the same. + constexpr static uint32_t mask(void) + { return T(~0); } + + constexpr static uint32_t byte_length(void) + { return sizeof(T); } + + constexpr static uint32_t bit_length(void) + { return sizeof(T) * 8; } template<typename U> inline static void write_element(void* i_data, T i_value, uint32_t i_offset) @@ -60,6 +65,6 @@ namespace fapi2 } }; /// @endcond -}; +} #endif |