1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-07-25 13:24:23 +00:00

Commutes uint8_t *, uint16_t *, uint32_t *, size_t, off_t and long to functional-style casts.

This commit is contained in:
Thomas Harte
2017-10-21 22:30:15 -04:00
parent e983854e71
commit ad9df4bb90
36 changed files with 164 additions and 164 deletions

View File

@@ -16,12 +16,12 @@ AllRAMProcessor::AllRAMProcessor(size_t memory_size) :
timestamp_(0) {}
void AllRAMProcessor::set_data_at_address(uint16_t startAddress, size_t length, const uint8_t *data) {
size_t endAddress = std::min(startAddress + length, (size_t)65536);
size_t endAddress = std::min(startAddress + length, static_cast<size_t>(65536));
memcpy(&memory_[startAddress], data, endAddress - startAddress);
}
void AllRAMProcessor::get_data_at_address(uint16_t startAddress, size_t length, uint8_t *data) {
size_t endAddress = std::min(startAddress + length, (size_t)65536);
size_t endAddress = std::min(startAddress + length, static_cast<size_t>(65536));
memcpy(data, &memory_[startAddress], endAddress - startAddress);
}