VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Buffer.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-12 12:30:04 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-12 12:30:04 +0200
commit455a4f2176a5cfbe325e1e40cea20dd3e466b64c (patch)
tree7a84d0f768ee375ea9f648bbbdeac7a4906f13fb /src/Platform/Buffer.h
parentbf9f3ec4f0a987ae1591ab5466f6eee599203c85 (diff)
downloadVeraCrypt-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/Buffer.h')
-rw-r--r--src/Platform/Buffer.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/Platform/Buffer.h b/src/Platform/Buffer.h
index 1150fcf5..a1eb0918 100644
--- a/src/Platform/Buffer.h
+++ b/src/Platform/Buffer.h
@@ -24,20 +24,20 @@ namespace VeraCrypt
public:
ConstBufferPtr ()
: DataPtr (nullptr), DataSize (0) { }
- ConstBufferPtr (const byte *data, size_t size)
+ ConstBufferPtr (const uint8 *data, size_t size)
: DataPtr (data), DataSize (size) { }
virtual ~ConstBufferPtr () { }
- operator const byte * () const { return DataPtr; }
+ operator const uint8 * () const { return DataPtr; }
bool IsDataEqual (const ConstBufferPtr &other) const { return Memory::Compare (DataPtr, DataSize, other.DataPtr, other.DataSize) == 0; }
- const byte *Get () const { return DataPtr; }
+ const uint8 *Get () const { return DataPtr; }
ConstBufferPtr GetRange (size_t offset, size_t size) const;
- void Set (const byte *data, size_t size) { DataPtr = data; DataSize = size; }
+ void Set (const uint8 *data, size_t size) { DataPtr = data; DataSize = size; }
size_t Size () const { return DataSize; }
protected:
- const byte *DataPtr;
+ const uint8 *DataPtr;
size_t DataSize;
};
@@ -47,23 +47,23 @@ namespace VeraCrypt
public:
BufferPtr ()
: DataPtr (nullptr), DataSize (0) { }
- BufferPtr (byte *data, size_t size)
+ BufferPtr (uint8 *data, size_t size)
: DataPtr (data), DataSize (size) { }
virtual ~BufferPtr () { }
- operator byte * () const { return DataPtr; }
+ operator uint8 * () const { return DataPtr; }
void CopyFrom (const ConstBufferPtr &bufferPtr) const;
void Erase () const { Zero(); }
- byte *Get () const { return DataPtr; }
+ uint8 *Get () const { return DataPtr; }
BufferPtr GetRange (size_t offset, size_t size) const;
- void Set (byte *data, size_t size) { DataPtr = data; DataSize = size; }
+ void Set (uint8 *data, size_t size) { DataPtr = data; DataSize = size; }
size_t Size () const { return DataSize; }
void Zero () const { Memory::Zero (DataPtr, DataSize); }
operator ConstBufferPtr () const { return ConstBufferPtr (DataPtr, DataSize); }
protected:
- byte *DataPtr;
+ uint8 *DataPtr;
size_t DataSize;
};
@@ -77,7 +77,7 @@ namespace VeraCrypt
virtual void Allocate (size_t size, size_t alignment = 0);
virtual void CopyFrom (const ConstBufferPtr &bufferPtr, size_t alignment = 0);
- virtual byte *Ptr () const { return DataPtr; }
+ virtual uint8 *Ptr () const { return DataPtr; }
virtual void Erase ();
virtual void Free ();
virtual BufferPtr GetRange (size_t offset, size_t size) const;
@@ -86,12 +86,12 @@ namespace VeraCrypt
virtual bool IsAllocated () const { return DataSize != 0; }
virtual void Zero ();
- virtual operator byte * () const { return DataPtr; }
+ virtual operator uint8 * () const { return DataPtr; }
virtual operator BufferPtr () const { return BufferPtr (DataPtr, DataSize); }
virtual operator ConstBufferPtr () const { return ConstBufferPtr (DataPtr, DataSize); }
protected:
- byte *DataPtr;
+ uint8 *DataPtr;
size_t DataSize;
size_t DataAlignment;