refactor: remove arrayWithLength, replace with std::vector

Eliminates the custom arrayWithLength<T> wrapper and all typedefs, replacing with std::vector<T> directly.
This commit is contained in:
MatthewBeshay
2026-03-31 12:06:19 +11:00
parent 27a4964941
commit 7ddfaeb59e
414 changed files with 2412 additions and 2724 deletions

View File

@@ -45,18 +45,18 @@ int ConsoleSaveFileInputStream::read() {
return static_cast<int>(byteRead);
}
// Reads up to b.length bytes of data from this input stream into an array of
// Reads up to b.size() bytes of data from this input stream into an array of
// bytes. This method blocks until some input is available. Parameters: b - the
// buffer into which the data is read. Returns: the total number of bytes read
// into the buffer, or -1 if there is no more data because the end of the file
// has been reached.
int ConsoleSaveFileInputStream::read(byteArray b) {
int ConsoleSaveFileInputStream::read(std::vector<uint8_t>& b) {
unsigned int numberOfBytesRead;
bool result =
m_saveFile->readFile(m_file,
&b.data, // data buffer
b.length, // number of bytes to read
b.data(), // data buffer
b.size(), // number of bytes to read
&numberOfBytesRead // number of bytes read
);
@@ -78,10 +78,10 @@ int ConsoleSaveFileInputStream::read(byteArray b) {
// b len - the maximum number of bytes read. Returns: the total number of bytes
// read into the buffer, or -1 if there is no more data because the end of the
// file has been reached.
int ConsoleSaveFileInputStream::read(byteArray b, unsigned int offset,
int ConsoleSaveFileInputStream::read(std::vector<uint8_t>& b, unsigned int offset,
unsigned int length) {
// 4J Stu - We don't want to read any more than the array buffer can hold
assert(length <= (b.length - offset));
assert(length <= (b.size() - offset));
unsigned int numberOfBytesRead;