aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/loadstor.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-13 15:28:30 -0400
committerJack Lloyd <[email protected]>2016-10-13 15:28:30 -0400
commit20f7e4ecb33aeafaf15adb9373f50b451e1fcf1e (patch)
treeeac4a527a1f1eeec8e83216e5727b81283dd1b5b /src/lib/utils/loadstor.h
parent704d754be3fb3e62c05f4c64bcb82a456ebb1b94 (diff)
util: Some simple constexpr uses
Remove unused and empty get_byte.h
Diffstat (limited to 'src/lib/utils/loadstor.h')
-rw-r--r--src/lib/utils/loadstor.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/utils/loadstor.h b/src/lib/utils/loadstor.h
index 9ae9fda0e..ebef45665 100644
--- a/src/lib/utils/loadstor.h
+++ b/src/lib/utils/loadstor.h
@@ -44,7 +44,7 @@ namespace Botan {
* @param input the value to extract from
* @return byte byte_num of input
*/
-template<typename T> inline byte get_byte(size_t byte_num, T input)
+template<typename T> inline constexpr byte get_byte(size_t byte_num, T input)
{
return static_cast<byte>(
input >> (((~byte_num)&(sizeof(T)-1)) << 3)
@@ -57,7 +57,7 @@ template<typename T> inline byte get_byte(size_t byte_num, T input)
* @param i1 the second byte
* @return i0 || i1
*/
-inline u16bit make_u16bit(byte i0, byte i1)
+inline constexpr u16bit make_u16bit(byte i0, byte i1)
{
return ((static_cast<u16bit>(i0) << 8) | i1);
}
@@ -70,7 +70,7 @@ inline u16bit make_u16bit(byte i0, byte i1)
* @param i3 the fourth byte
* @return i0 || i1 || i2 || i3
*/
-inline u32bit make_u32bit(byte i0, byte i1, byte i2, byte i3)
+inline constexpr u32bit make_u32bit(byte i0, byte i1, byte i2, byte i3)
{
return ((static_cast<u32bit>(i0) << 24) |
(static_cast<u32bit>(i1) << 16) |
@@ -90,8 +90,8 @@ inline u32bit make_u32bit(byte i0, byte i1, byte i2, byte i3)
* @param i7 the eighth byte
* @return i0 || i1 || i2 || i3 || i4 || i5 || i6 || i7
*/
-inline u64bit make_u64bit(byte i0, byte i1, byte i2, byte i3,
- byte i4, byte i5, byte i6, byte i7)
+inline constexpr u64bit make_u64bit(byte i0, byte i1, byte i2, byte i3,
+ byte i4, byte i5, byte i6, byte i7)
{
return ((static_cast<u64bit>(i0) << 56) |
(static_cast<u64bit>(i1) << 48) |