mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Eliminate Location in favour of Layout.
This commit is contained in:
@@ -291,7 +291,8 @@ public:
|
||||
|
||||
auto& filename = path.back();
|
||||
if (filename.size() > 8)
|
||||
throw CannotWriteException("filename too long (eight characters maximum)");
|
||||
throw CannotWriteException(
|
||||
"filename too long (eight characters maximum)");
|
||||
|
||||
int sectorLength = (data.size() + SECTOR_SIZE - 1) / SECTOR_SIZE;
|
||||
if (sectorLength > 0xff)
|
||||
|
||||
@@ -56,14 +56,14 @@ public:
|
||||
|
||||
void flushChanges() override
|
||||
{
|
||||
std::set<Location> locations;
|
||||
std::vector<std::shared_ptr<const Layout>> locations;
|
||||
|
||||
for (const auto& trackid : _changedTracks)
|
||||
{
|
||||
unsigned track = trackid.first;
|
||||
unsigned side = trackid.second;
|
||||
auto trackLayout = Layout::getLayoutOfTrack(track, side);
|
||||
locations.insert(Layout::computeLocationFor(track, side));
|
||||
locations.push_back(trackLayout);
|
||||
|
||||
/* If we don't have all the sectors of this track, we may need to
|
||||
* populate any non-changed sectors as we can only write a track at
|
||||
@@ -128,8 +128,8 @@ private:
|
||||
|
||||
void populateSectors(unsigned track, unsigned side)
|
||||
{
|
||||
auto location = Layout::computeLocationFor(track, side);
|
||||
auto trackdata = readAndDecodeTrack(*_fluxSource, *_decoder, location);
|
||||
auto layout = Layout::getLayoutOfTrack(track, side);
|
||||
auto trackdata = readAndDecodeTrack(*_fluxSource, *_decoder, layout);
|
||||
|
||||
for (const auto& sector : trackdata->sectors)
|
||||
*_loadedSectors.put(track, side, sector->logicalSector) = *sector;
|
||||
|
||||
Reference in New Issue
Block a user