diff options
author | 2024-02-25 02:27:26 +1100 | |
---|---|---|
committer | 2024-02-25 02:27:26 +1100 | |
commit | 1615b8551a3a73532ac234973cfb04dd8ed98ba4 (patch) | |
tree | 25575506b4117afa614b94b4370af7f16eb9dbb5 /src/devices/cpu/h8/h8.cpp | |
parent | 334ec12e0043ef939be418283235e3dbe5a005fe (diff) |
util/ioprocs.cpp: Added wrappers for common patterns. (#11608)
emu/diimage.h: Removed fread overloads that allocate memory for output.
util/core_file.cpp: Changed output size of load to size_t.
Diffstat (limited to 'src/devices/cpu/h8/h8.cpp')
-rw-r--r-- | src/devices/cpu/h8/h8.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index 9f30efc8991..131f9aabf4c 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -215,11 +215,10 @@ bool h8_device::nvram_write(util::write_stream &file) if(!m_nvram_battery) return true; - size_t actual; - // internal RAM if(m_internal_ram) { - if(file.write(&m_internal_ram[0], m_internal_ram.bytes(), actual) || m_internal_ram.bytes() != actual) + auto const [err, actual] = write(file, &m_internal_ram[0], m_internal_ram.bytes()); + if(err) return false; } @@ -234,11 +233,10 @@ bool h8_device::nvram_write(util::write_stream &file) bool h8_device::nvram_read(util::read_stream &file) { - size_t actual; - // internal RAM if(m_internal_ram) { - if(file.read(&m_internal_ram[0], m_internal_ram.bytes(), actual) || m_internal_ram.bytes() != actual) + auto const [err, actual] = read(file, &m_internal_ram[0], m_internal_ram.bytes()); + if (err || (m_internal_ram.bytes() != actual)) return false; } |