Avoid conflict with C++17 features std::byte by using uint8 type instead of byte

This commit is contained in:
Mounir IDRASSI
2024-06-12 12:30:04 +02:00
parent bf9f3ec4f0
commit 455a4f2176
132 changed files with 1032 additions and 1035 deletions
+3 -3
View File
@@ -76,7 +76,7 @@ namespace VeraCrypt
Buffer buffer (10);
for (size_t i = 0; i < buffer.Size(); i++)
buffer[i] = (byte) i;
buffer[i] = (uint8) i;
ser.Serialize ("int32", i32);
ser.Serialize ("int64", i64);
@@ -141,7 +141,7 @@ namespace VeraCrypt
Buffer dbuffer (10);
ser.Deserialize ("buffer", buffer);
for (size_t i = 0; i < buffer.Size(); i++)
if (buffer[i] != (byte) i)
if (buffer[i] != (uint8) i)
throw TestFailed (SRC_POS);
shared_ptr <ExecutedProcessFailed> dex = Serializable::DeserializeNew <ExecutedProcessFailed> (stream);
@@ -238,7 +238,7 @@ namespace VeraCrypt
bool PlatformTest::TestAll ()
{
// Integer types
if (sizeof (byte) != 1 || sizeof (int8) != 1 || sizeof (__int8) != 1) throw TestFailed (SRC_POS);
if (sizeof (uint8) != 1 || sizeof (int8) != 1 || sizeof (__int8) != 1) throw TestFailed (SRC_POS);
if (sizeof (uint16) != 2 || sizeof (int16) != 2 || sizeof (__int16) != 2) throw TestFailed (SRC_POS);
if (sizeof (uint32) != 4 || sizeof (int32) != 4 || sizeof (__int32) != 4) throw TestFailed (SRC_POS);
if (sizeof (uint64) != 8 || sizeof (int64) != 8) throw TestFailed (SRC_POS);