summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/simh_tape_file.cpp
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2024-02-25 02:27:26 +1100
committer GitHub <noreply@github.com>2024-02-25 02:27:26 +1100
commit1615b8551a3a73532ac234973cfb04dd8ed98ba4 (patch)
tree25575506b4117afa614b94b4370af7f16eb9dbb5 /src/lib/util/simh_tape_file.cpp
parent334ec12e0043ef939be418283235e3dbe5a005fe (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/lib/util/simh_tape_file.cpp')
-rw-r--r--src/lib/util/simh_tape_file.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/util/simh_tape_file.cpp b/src/lib/util/simh_tape_file.cpp
index 4fe1af5ae88..ffd6a48aeb3 100644
--- a/src/lib/util/simh_tape_file.cpp
+++ b/src/lib/util/simh_tape_file.cpp
@@ -119,16 +119,14 @@ void simh_tape_file::raw_seek(const osd::u64 pos) const
void simh_tape_file::raw_read(osd::u8 *const buf, const osd::u32 len) const
{
- size_t actual_len;
- std::error_condition err = m_file.read(buf, len, actual_len);
+ auto const [err, actual_len] = read(m_file, buf, len);
if (err || actual_len != len) // error: we failed to read expected number of bytes
throw std::runtime_error(std::string("failed read: ") + (err ? err.message() : std::string("unexpected length")));
}
void simh_tape_file::raw_write(const osd::u8 *const buf, const osd::u32 len) const
{
- size_t actual_len;
- std::error_condition err = m_file.write(buf, len, actual_len);
+ auto const [err, actual_len] = write(m_file, buf, len);
if (err || actual_len != len) // error: we failed to write expected number of bytes
throw std::runtime_error(std::string("failed write: ") + (err ? err.message() : std::string("unexpected length")));
}