Make the internal disk data structures all const, to allow us to pass them to

the GUI UI thread safely.
This commit is contained in:
David Given
2022-02-24 22:46:10 +01:00
parent 4a0fc3d566
commit eade2e279e
22 changed files with 331 additions and 276 deletions

View File

@@ -57,7 +57,7 @@ std::unique_ptr<AbstractDecoder> AbstractDecoder::create(const DecoderProto& con
return (decoder->second)(config);
}
std::shared_ptr<TrackDataFlux> AbstractDecoder::decodeToSectors(
std::shared_ptr<const TrackDataFlux> AbstractDecoder::decodeToSectors(
std::shared_ptr<const Fluxmap> fluxmap, unsigned physicalCylinder, unsigned physicalHead)
{
_trackdata = std::make_shared<TrackDataFlux>();
@@ -84,7 +84,7 @@ std::shared_ptr<TrackDataFlux> AbstractDecoder::decodeToSectors(
Fluxmap::Position recordStart = fmr.tell();
_sector->clock = advanceToNextRecord();
if (fmr.eof() || !_sector->clock)
return std::move(_trackdata);
return _trackdata;
/* Read the sector record. */