From bb33a43d54dc39c9c64dc10fad253e003e4813c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 29 Sep 2023 11:05:27 +0200 Subject: [PATCH] Remove superfluous chd_read_header (until we add parent/child chd support) --- Core/FileSystems/BlockDevices.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 44ec74a9cdb2..eaeb4c6261ee 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -545,15 +545,18 @@ struct CHDImpl { CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader) : BlockDevice(fileLoader), impl_(new CHDImpl()) { + Path paths[8]; + paths[0] = fileLoader->GetPath(); + int depth = 0; + + /* + // TODO: Support parent/child CHD files. + // Default, in case of failure numBlocks = 0; chd_header childHeader; - int depth = 0; - Path paths[8]; - paths[0] = fileLoader->GetPath(); - chd_error err = chd_read_header(paths[0].c_str(), &childHeader); if (err != CHDERR_NONE) { ERROR_LOG(LOADER, "Error loading CHD header for '%s': %s", paths[0].c_str(), chd_error_string(err)); @@ -561,8 +564,6 @@ CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader) return; } - /* - // TODO: Support parent/child CHD files. if (memcmp(nullsha1, childHeader.parentsha1, sizeof(childHeader.sha1)) != 0) { chd_header parentHeader; @@ -607,7 +608,7 @@ CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader) NotifyReadError(); return; } - err = chd_open_file(file, CHD_OPEN_READ, NULL, &child); + chd_error err = chd_open_file(file, CHD_OPEN_READ, NULL, &child); if (err != CHDERR_NONE) { ERROR_LOG(LOADER, "Error loading CHD '%s': %s", paths[depth].c_str(), chd_error_string(err)); NotifyReadError();