Skip to content

Commit

Permalink
Remove superfluous chd_read_header (until we add parent/child chd sup…
Browse files Browse the repository at this point in the history
…port)
  • Loading branch information
hrydgard committed Sep 29, 2023
1 parent 2f5f9df commit bb33a43
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Core/FileSystems/BlockDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,24 +545,25 @@ 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));
NotifyReadError();
return;
}
/*
// TODO: Support parent/child CHD files.
if (memcmp(nullsha1, childHeader.parentsha1, sizeof(childHeader.sha1)) != 0) {
chd_header parentHeader;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit bb33a43

Please sign in to comment.