Annotate or remove unused elements.

This commit is contained in:
2023-10-05 01:05:23 +01:00
parent 7c9405492c
commit 9618e2c549
168 changed files with 397 additions and 216 deletions

View File

@@ -34,6 +34,8 @@ using System;
using Aaru.Console;
using Aaru.Decoders.ATA;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -31,11 +31,16 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Decoders.ATA;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")]
public partial class Device
{
/// <summary>Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout</summary>

View File

@@ -31,11 +31,17 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Decoders.ATA;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
public partial class Device
{
/// <summary>Enables media card pass through</summary>

View File

@@ -33,6 +33,8 @@
using System;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -34,6 +34,8 @@
using System;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -33,6 +33,8 @@
using System;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -32,6 +32,8 @@
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -35,8 +35,11 @@ using System.Diagnostics.CodeAnalysis;
using System.Text;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
public partial class Device
{
/// <summary>Sends the MMC GET CONFIGURATION command for all Features</summary>

View File

@@ -35,6 +35,8 @@
using System;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -32,6 +32,8 @@
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -35,9 +35,12 @@ using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using PlatformID = Aaru.CommonTypes.Interop.PlatformID;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
public partial class Device
{
/// <summary>Sends the SPC INQUIRY command to the device using default device timeout.</summary>

View File

@@ -31,10 +31,14 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
public partial class Device
{
/// <summary>Prepares the medium for reading</summary>

View File

@@ -33,6 +33,8 @@
using System;
using Aaru.Console;
// ReSharper disable UnusedMember.Global
namespace Aaru.Devices;
public partial class Device

View File

@@ -32,10 +32,12 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Devices.Linux;
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
enum FileFlags
{
/// <summary>O_RDONLY</summary>
@@ -89,6 +91,7 @@ enum ScsiIoctlDirection
Unknown = -5
}
[SuppressMessage("ReSharper", "UnusedMember.Global")]
enum LinuxIoctl : uint
{
// SCSI IOCtls
@@ -101,6 +104,7 @@ enum LinuxIoctl : uint
}
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
enum SgInfo : uint
{
/// <summary>Mask to check OK</summary>
@@ -121,6 +125,7 @@ enum SgInfo : uint
}
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
enum SgFlags : uint
{
DirectIo = 1,
@@ -131,6 +136,7 @@ enum SgFlags : uint
QAtHead = 0x20
}
[SuppressMessage("ReSharper", "UnusedMember.Global")]
enum SeekWhence
{
Begin = 0,

View File

@@ -43,9 +43,6 @@ static class Extern
[DllImport("libc")]
internal static extern int close(int fd);
[DllImport("libc", EntryPoint = "ioctl", SetLastError = true)]
internal static extern int ioctlInt(int fd, LinuxIoctl request, out int value);
[DllImport("libc", EntryPoint = "ioctl", SetLastError = true)]
internal static extern int ioctlSg(int fd, LinuxIoctl request, ref SgIoHdrT value);

View File

@@ -59,6 +59,7 @@ public sealed partial class Device : Devices.Device
}
/// <summary>Current device is remote</summary>
// ReSharper disable once UnusedMember.Global
public bool IsRemote => _remote != null;
/// <summary>Remote application</summary>

View File

@@ -30,6 +30,8 @@
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Devices.Remote;
/// <summary>Packet type enumeration</summary>
@@ -73,6 +75,7 @@ public enum AaruPacketType : sbyte
}
/// <summary>Reasons for non-data request or response</summary>
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public enum AaruNopReason : byte
{
/// <summary>Request or response has arrived unexpectedly</summary>

View File

@@ -32,11 +32,13 @@
// ****************************************************************************/
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
namespace Aaru.Devices.Windows;
[SuppressMessage("ReSharper", "UnusedMember.Global")]
static class Extern
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]

View File

@@ -155,6 +155,7 @@ struct StoragePropertyQuery
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "UnusedType.Global")]
struct StorageDescriptorHeader
{
public uint Version;
@@ -206,6 +207,7 @@ struct StorageDeviceNumber
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "UnusedType.Global")]
struct DeviceInfoData
{
public int cbSize;
@@ -237,6 +239,7 @@ struct UsbSetupPacket
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "UnusedType.Global")]
struct UsbDescriptorRequest
{
public int ConnectionIndex;

View File

@@ -44,6 +44,7 @@ namespace Aaru.Devices.Windows;
/// <summary>Implements functions for getting and accessing information from the USB bus</summary>
[SuppressMessage("ReSharper", "UnusedMember.Local")]
[SuppressMessage("ReSharper", "UnusedType.Local")]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
static partial class Usb
{
/// <summary>Return a list of USB Host Controllers</summary>

View File

@@ -33,6 +33,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace Aaru.Devices.Windows;
@@ -43,6 +44,7 @@ namespace Aaru.Devices.Windows;
//
// TODO: Even after cleaning, refactoring and xml-documenting, this code needs some love
/// <summary>Implements functions for getting and accessing information from the USB bus</summary>
[SuppressMessage("ReSharper", "UnusedMember.Global")]
static partial class Usb
{
const int IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080;