From 73b44c94291c4d086477167a76fd7db239936c3b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 6 Mar 2016 18:02:37 +1100 Subject: Turn core_file into a proper class that gets cleaned up safely using unique_ptr Subverted somewhat by chd_file class --- src/lib/util/chd.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/util/chd.h') diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h index d9a1dd57f51..ee8a03f5d17 100644 --- a/src/lib/util/chd.h +++ b/src/lib/util/chd.h @@ -304,7 +304,7 @@ public: virtual ~chd_file(); // operators - operator core_file *() { return m_file; } + operator util::core_file &() { return *m_file; } // getters bool opened() const { return (m_file != nullptr); } @@ -328,13 +328,13 @@ public: // file create chd_error create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); - chd_error create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); + chd_error create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); chd_error create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent); - chd_error create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent); + chd_error create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent); // file open chd_error open(const char *filename, bool writeable = false, chd_file *parent = nullptr); - chd_error open(core_file &file, bool writeable = false, chd_file *parent = nullptr); + chd_error open(util::core_file &file, bool writeable = false, chd_file *parent = nullptr); // file close void close(); @@ -401,7 +401,7 @@ private: static int CLIB_DECL metadata_hash_compare(const void *elem1, const void *elem2); // file characteristics - core_file * m_file; // handle to the open core file + util::core_file * m_file; // handle to the open core file bool m_owns_file; // flag indicating if this file should be closed on chd_close() bool m_allow_reads; // permit reads from this CHD? bool m_allow_writes; // permit writes to this CHD? -- cgit v1.2.3-70-g09d2