summaryrefslogtreecommitdiffstats
path: root/import/hwpf/fapi2/include/buffer_traits.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_traits.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_traits.H')
-rw-r--r--import/hwpf/fapi2/include/buffer_traits.H13
1 files changed, 9 insertions, 4 deletions
diff --git a/import/hwpf/fapi2/include/buffer_traits.H b/import/hwpf/fapi2/include/buffer_traits.H
index b9362386..632c9d2e 100644
--- a/import/hwpf/fapi2/include/buffer_traits.H
+++ b/import/hwpf/fapi2/include/buffer_traits.H
@@ -43,7 +43,10 @@ namespace fapi2
{
/// @cond
/// Types representing a container of bits. Used to create
- /// variable_buffer.
+ /// variable_buffer. container_unit must remain 32-bits
+ /// for now - there will be a lot of code to change if it
+ /// changes. There are assertions helping to enforce this
+ /// in places in the code.
typedef uint32_t container_unit;
typedef std::vector<container_unit> bits_container;
@@ -137,7 +140,8 @@ namespace fapi2
typedef B bits_type;
typedef T unit_type;
- enum { bits_per_unit = sizeof(unit_type) * 8 };
+ constexpr static uint32_t bits_per_unit(void)
+ { return sizeof(unit_type) * 8; }
};
//
@@ -222,10 +226,11 @@ namespace fapi2
typedef uint32_t bits_type;
typedef container_unit unit_type;
- enum { bits_per_unit = sizeof(unit_type) * 8 };
+ constexpr static uint32_t bits_per_unit(void)
+ { return sizeof(unit_type) * 8; }
};
/// @endcond
-};
+}
OpenPOWER on IntegriCloud