Formatting and cleanup

This commit is contained in:
Maschell 2021-10-11 22:45:38 +02:00
parent d933b645d8
commit eb74e76edd

View File

@ -593,7 +593,7 @@ bool ApplicationState::writeDataToFile(void *buffer, int numberOfSectors) {
snprintf(tmp, 33, "%08X%08X%08X%08X", test[0], test[1], test[2], test[3]); snprintf(tmp, 33, "%08X%08X%08X%08X", test[0], test[1], test[2], test[3]);
std::string hash(tmp); std::string hash(tmp);
uint32_t *indexTable = (uint32_t *) this->sectorIndexTable; auto *indexTable = (uint32_t *) this->sectorIndexTable;
auto it = hashMap.find(hash); auto it = hashMap.find(hash);
if (it != hashMap.end()) { if (it != hashMap.end()) {
@ -616,8 +616,6 @@ bool ApplicationState::writeDataToFile(void *buffer, int numberOfSectors) {
} }
bool ApplicationState::writeCached(uint32_t addr, uint32_t writeSize) { bool ApplicationState::writeCached(uint32_t addr, uint32_t writeSize) {
// DEBUG_FUNCTION_LINE("Lest write %d bytes", writeSize);
if (writeSize == this->writeBufferSize) { if (writeSize == this->writeBufferSize) {
if (!this->flushWriteCache()) { if (!this->flushWriteCache()) {
return false; return false;
@ -639,7 +637,6 @@ bool ApplicationState::writeCached(uint32_t addr, uint32_t writeSize) {
if (this->writeBufferPos + curWrite > this->writeBufferSize) { if (this->writeBufferPos + curWrite > this->writeBufferSize) {
curWrite = this->writeBufferSize - this->writeBufferPos; curWrite = this->writeBufferSize - this->writeBufferPos;
} }
// DEBUG_FUNCTION_LINE("Copy from %08X into %08X, size %08X, %d",(addr + written),((uint32_t) this->writeBuffer) + this->writeBufferPos, curWrite, this->writeBufferPos/READ_SECTOR_SIZE);
OSBlockMove((void *) (((uint32_t) this->writeBuffer) + this->writeBufferPos), (void *) (addr + written), curWrite, 1); OSBlockMove((void *) (((uint32_t) this->writeBuffer) + this->writeBufferPos), (void *) (addr + written), curWrite, 1);
this->writeBufferPos += curWrite; this->writeBufferPos += curWrite;