From 4239348a21d67729d5c11ee124425fa006662fd9 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 16 Oct 2016 10:46:16 -0400 Subject: Remove constexpr use introduced in 20f7e4ec Turns out MSVC 2013 doesn't have constexpr at all (!!) --- src/lib/utils/loadstor.h | 10 +++++----- src/lib/utils/rotate.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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 inline constexpr byte get_byte(size_t byte_num, T input) +template inline byte get_byte(size_t byte_num, T input) { return static_cast( input >> (((~byte_num)&(sizeof(T)-1)) << 3) @@ -57,7 +57,7 @@ template 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(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(i0) << 24) | (static_cast(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(i0) << 56) | (static_cast(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 inline constexpr T rotate_left(T input, size_t rot) +template inline T rotate_left(T input, size_t rot) { return (rot == 0) ? input : static_cast((input << rot) | (input >> (8*sizeof(T)-rot)));; } @@ -29,7 +29,7 @@ template 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 inline constexpr T rotate_right(T input, size_t rot) +template inline T rotate_right(T input, size_t rot) { return (rot == 0) ? input : static_cast((input >> rot) | (input << (8*sizeof(T)-rot))); } -- cgit v1.2.3