diff options
author | Jack Lloyd <[email protected]> | 2016-10-16 10:46:16 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-16 10:46:16 -0400 |
commit | 4239348a21d67729d5c11ee124425fa006662fd9 (patch) | |
tree | 16b86e3b81e79d46ade2af6aba38bb52a822315e /src/lib/utils | |
parent | 57b00f64749ef96b211380ff0933eb2203646ba7 (diff) |
Remove constexpr use introduced in 20f7e4ec
Turns out MSVC 2013 doesn't have constexpr at all (!!)
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/loadstor.h | 10 | ||||
-rw-r--r-- | src/lib/utils/rotate.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/utils/loadstor.h b/src/lib/utils/loadstor.h index ebef45665..9ae9fda0e 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 constexpr byte get_byte(size_t byte_num, T input) +template<typename T> inline 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 constexpr byte get_byte(size_t byte_num, T input) * @param i1 the second byte * @return i0 || i1 */ -inline constexpr u16bit make_u16bit(byte i0, byte i1) +inline u16bit make_u16bit(byte i0, byte i1) { return ((static_cast<u16bit>(i0) << 8) | i1); } @@ -70,7 +70,7 @@ inline constexpr u16bit make_u16bit(byte i0, byte i1) * @param i3 the fourth byte * @return i0 || i1 || i2 || i3 */ -inline constexpr u32bit make_u32bit(byte i0, byte i1, byte i2, byte i3) +inline 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 constexpr 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 constexpr u64bit make_u64bit(byte i0, byte i1, byte i2, byte i3, - byte i4, byte i5, byte i6, byte i7) +inline 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) | diff --git a/src/lib/utils/rotate.h b/src/lib/utils/rotate.h index 126a49314..b936521e6 100644 --- a/src/lib/utils/rotate.h +++ b/src/lib/utils/rotate.h @@ -18,7 +18,7 @@ namespace Botan { * @param rot the number of bits to rotate * @return input rotated left by rot bits */ -template<typename T> inline constexpr T rotate_left(T input, size_t rot) +template<typename T> inline T rotate_left(T input, size_t rot) { return (rot == 0) ? input : static_cast<T>((input << rot) | (input >> (8*sizeof(T)-rot)));; } @@ -29,7 +29,7 @@ template<typename T> inline constexpr T rotate_left(T input, size_t rot) * @param rot the number of bits to rotate * @return input rotated right by rot bits */ -template<typename T> inline constexpr T rotate_right(T input, size_t rot) +template<typename T> inline T rotate_right(T input, size_t rot) { return (rot == 0) ? input : static_cast<T>((input >> rot) | (input << (8*sizeof(T)-rot))); } |