diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-06-12 12:30:04 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-06-12 12:30:04 +0200 |
commit | 455a4f2176a5cfbe325e1e40cea20dd3e466b64c (patch) | |
tree | 7a84d0f768ee375ea9f648bbbdeac7a4906f13fb /src/Platform/Memory.h | |
parent | bf9f3ec4f0a987ae1591ab5466f6eee599203c85 (diff) | |
download | VeraCrypt-455a4f2176a5cfbe325e1e40cea20dd3e466b64c.tar.gz VeraCrypt-455a4f2176a5cfbe325e1e40cea20dd3e466b64c.zip |
Avoid conflict with C++17 features std::byte by using uint8 type instead of byte
Diffstat (limited to 'src/Platform/Memory.h')
-rw-r--r-- | src/Platform/Memory.h | 28 |
1 files changed, 14 insertions, 14 deletions
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); } }; } |