General cleanup and refactor.

This commit is contained in:
2022-03-07 07:36:44 +00:00
parent bc6e432565
commit 762e3eb6d2
1321 changed files with 44657 additions and 45479 deletions

View File

@@ -30,13 +30,13 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Core.Devices.Scanning;
using System;
using System.Collections.Generic;
using Aaru.CommonTypes.Structs.Devices.ATA;
using Aaru.Core.Logging;
namespace Aaru.Core.Devices.Scanning;
/// <summary>Implements scanning the media from an ATA device</summary>
public sealed partial class MediaScan
{
@@ -210,12 +210,12 @@ public sealed partial class MediaScan
InitProgress?.Invoke();
if(ataReader.CanSeekLba && _seekTest)
for(int i = 0; i < seekTimes; i++)
for(var i = 0; i < seekTimes; i++)
{
if(_aborted)
break;
uint seekPos = (uint)rnd.Next((int)results.Blocks);
var seekPos = (uint)rnd.Next((int)results.Blocks);
PulseProgress?.Invoke($"Seeking to sector {seekPos}...\t\t");
@@ -326,17 +326,16 @@ public sealed partial class MediaScan
InitProgress?.Invoke();
if(ataReader.CanSeek)
for(int i = 0; i < seekTimes; i++)
for(var i = 0; i < seekTimes; i++)
{
if(_aborted)
break;
ushort seekCy = (ushort)rnd.Next(cylinders);
byte seekHd = (byte)rnd.Next(heads);
byte seekSc = (byte)rnd.Next(sectors);
var seekCy = (ushort)rnd.Next(cylinders);
var seekHd = (byte)rnd.Next(heads);
var seekSc = (byte)rnd.Next(sectors);
PulseProgress?.
Invoke($"\rSeeking to cylinder {seekCy}, head {seekHd}, sector {seekSc}...\t\t");
PulseProgress?.Invoke($"\rSeeking to cylinder {seekCy}, head {seekHd}, sector {seekSc}...\t\t");
ataReader.SeekChs(seekCy, seekHd, seekSc, out seekCur);