summaryrefslogtreecommitdiffstats
path: root/import/hwpf/fapi2/include/buffer_parameters.H
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2015-03-13 10:50:16 -0500
committerJoshua Hunsberger <jahunsbe@us.ibm.com>2017-10-23 15:50:55 -0500
commit6a295a9a34aedea8cc60a0247500cd2e083c411e (patch)
tree839a43c0f5166f125dee291393977c6faa6fb840 /import/hwpf/fapi2/include/buffer_parameters.H
parent2cb6e4bc7949ea1846bb11c8e0f3ced3d7112837 (diff)
downloadtalos-hcode-6a295a9a34aedea8cc60a0247500cd2e083c411e.tar.gz
talos-hcode-6a295a9a34aedea8cc60a0247500cd2e083c411e.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>
Diffstat (limited to 'import/hwpf/fapi2/include/buffer_parameters.H')
-rw-r--r--import/hwpf/fapi2/include/buffer_parameters.H19
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 90b3db45..49d5444d 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
OpenPOWER on IntegriCloud