mirror of https://github.com/libAthena/athena.git
MemoryWriter: Initialize member variables to deterministic values
Makes the variable initialization behavior deterministic in the case of the default constructor. This also eliminates the possibility of an uninitialized read from occurring within the destructor entirely; even in the face of future changes.
This commit is contained in:
parent
f099ee0b1b
commit
016e14c460
|
@ -90,11 +90,11 @@ public:
|
||||||
void writeUBytes(const atUint8* data, atUint64 length) override;
|
void writeUBytes(const atUint8* data, atUint64 length) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MemoryWriter() {}
|
MemoryWriter() = default;
|
||||||
atUint8* m_data;
|
atUint8* m_data = nullptr;
|
||||||
atUint64 m_length;
|
atUint64 m_length = 0;
|
||||||
atUint64 m_position;
|
atUint64 m_position = 0;
|
||||||
bool m_bufferOwned;
|
bool m_bufferOwned = false;
|
||||||
std::string m_filepath; //!< Path to the target file
|
std::string m_filepath; //!< Path to the target file
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue