From 455a4f2176a5cfbe325e1e40cea20dd3e466b64c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 12 Jun 2024 12:30:04 +0200 Subject: Avoid conflict with C++17 features std::byte by using uint8 type instead of byte --- src/Platform/Memory.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Platform/Memory.h') diff --git a/src/Platform/Memory.h b/src/Platform/Memory.h index e0d4bfe3..b124022f 100644 --- a/src/Platform/Memory.h +++ b/src/Platform/Memory.h @@ -85,7 +85,7 @@ namespace VeraCrypt class Endian { public: - static byte Big (const byte &x) + static uint8 Big (const uint8 &x) { return x; } @@ -117,7 +117,7 @@ namespace VeraCrypt #endif } - static byte Little (const byte &x) + static uint8 Little (const uint8 &x) { return x; } @@ -157,22 +157,22 @@ namespace VeraCrypt static uint32 MirrorBytes (const uint32 &x) { - uint32 n = (byte) x; - n <<= 8; n |= (byte) (x >> 8); - n <<= 8; n |= (byte) (x >> 16); - return (n << 8) | (byte) (x >> 24); + uint32 n = (uint8) x; + n <<= 8; n |= (uint8) (x >> 8); + n <<= 8; n |= (uint8) (x >> 16); + return (n << 8) | (uint8) (x >> 24); } static uint64 MirrorBytes (const uint64 &x) { - uint64 n = (byte) x; - n <<= 8; n |= (byte) (x >> 8); - n <<= 8; n |= (byte) (x >> 16); - n <<= 8; n |= (byte) (x >> 24); - n <<= 8; n |= (byte) (x >> 32); - n <<= 8; n |= (byte) (x >> 40); - n <<= 8; n |= (byte) (x >> 48); - return (n << 8) | (byte) (x >> 56); + uint64 n = (uint8) x; + n <<= 8; n |= (uint8) (x >> 8); + n <<= 8; n |= (uint8) (x >> 16); + n <<= 8; n |= (uint8) (x >> 24); + n <<= 8; n |= (uint8) (x >> 32); + n <<= 8; n |= (uint8) (x >> 40); + n <<= 8; n |= (uint8) (x >> 48); + return (n << 8) | (uint8) (x >> 56); } }; } -- cgit v1.2.3