Fix warnings from nullabilty

This commit is contained in:
Matt Nadareski
2023-09-04 21:14:41 -04:00
parent 46824bd91d
commit 0e23d131fe
212 changed files with 3018 additions and 1 deletions

View File

@@ -19,7 +19,11 @@ namespace SabreTools.Models.LinearExecutable
/// <summary>
/// The signature consists of a string of three (3) ASCII characters: "NB0"
/// </summary>
#if NET48
public string Signature;
#else
public string? Signature;
#endif
/// <summary>
/// This defines the type of debugger data that exists in the remainder of the
@@ -33,6 +37,10 @@ namespace SabreTools.Models.LinearExecutable
/// the responsibility of the linker or debugging tools to follow the convention
/// for the type field that is defined here.
/// </summary>
#if NET48
public byte[] DebuggerData;
#else
public byte[]? DebuggerData;
#endif
}
}

View File

@@ -54,6 +54,10 @@ namespace SabreTools.Models.LinearExecutable
/// <summary>
/// Table entries in the bundle
/// </summary>
#if NET48
public EntryTableEntry[] TableEntries;
#else
public EntryTableEntry[]? TableEntries;
#endif
}
}

View File

@@ -13,85 +13,149 @@ namespace SabreTools.Models.LinearExecutable
/// <summary>
/// MS-DOS executable stub
/// </summary>
#if NET48
public MSDOS.Executable Stub { get; set; }
#else
public MSDOS.Executable? Stub { get; set; }
#endif
/// <summary>
/// Information block
/// </summary>
#if NET48
public InformationBlock InformationBlock { get; set; }
#else
public InformationBlock? InformationBlock { get; set; }
#endif
/// <summary>
/// Object table
/// </summary>
#if NET48
public ObjectTableEntry[] ObjectTable { get; set; }
#else
public ObjectTableEntry[]? ObjectTable { get; set; }
#endif
/// <summary>
/// Object page map
/// </summary>
#if NET48
public ObjectPageMapEntry[] ObjectPageMap { get; set; }
#else
public ObjectPageMapEntry[]? ObjectPageMap { get; set; }
#endif
// TODO: Object iterate data map table (Undefined)
/// <summary>
/// Resource table
/// </summary>
#if NET48
public ResourceTableEntry[] ResourceTable { get; set; }
#else
public ResourceTableEntry[]? ResourceTable { get; set; }
#endif
/// <summary>
/// Resident Name table
/// </summary>
#if NET48
public ResidentNamesTableEntry[] ResidentNamesTable { get; set; }
#else
public ResidentNamesTableEntry[]? ResidentNamesTable { get; set; }
#endif
/// <summary>
/// Entry table
/// </summary>
#if NET48
public EntryTableBundle[] EntryTable { get; set; }
#else
public EntryTableBundle[]? EntryTable { get; set; }
#endif
/// <summary>
/// Module format directives table (optional)
/// </summary>
#if NET48
public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; }
#else
public ModuleFormatDirectivesTableEntry[]? ModuleFormatDirectivesTable { get; set; }
#endif
/// <summary>
/// Verify record directive table (optional)
/// </summary>
#if NET48
public VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable { get; set; }
#else
public VerifyRecordDirectiveTableEntry[]? VerifyRecordDirectiveTable { get; set; }
#endif
/// <summary>
/// Fix-up page table
/// </summary>
#if NET48
public FixupPageTableEntry[] FixupPageTable { get; set; }
#else
public FixupPageTableEntry[]? FixupPageTable { get; set; }
#endif
/// <summary>
/// Fix-up record table
/// </summary>
#if NET48
public FixupRecordTableEntry[] FixupRecordTable { get; set; }
#else
public FixupRecordTableEntry[]? FixupRecordTable { get; set; }
#endif
/// <summary>
/// Import module name table
/// </summary>
#if NET48
public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; }
#else
public ImportModuleNameTableEntry[]? ImportModuleNameTable { get; set; }
#endif
/// <summary>
/// Import procedure name table
/// </summary>
#if NET48
public ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable { get; set; }
#else
public ImportModuleProcedureNameTableEntry[]? ImportModuleProcedureNameTable { get; set; }
#endif
/// <summary>
/// Per-Page checksum table
/// </summary>
#if NET48
public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; }
#else
public PerPageChecksumTableEntry[]? PerPageChecksumTable { get; set; }
#endif
/// <summary>
/// Non-Resident Name table
/// </summary>
#if NET48
public NonResidentNamesTableEntry[] NonResidentNamesTable { get; set; }
#else
public NonResidentNamesTableEntry[]? NonResidentNamesTable { get; set; }
#endif
// TODO: Non-resident directives data (Undefined)
/// <summary>
/// Debug information
/// </summary>
#if NET48
public DebugInformation DebugInformation { get; set; }
#else
public DebugInformation? DebugInformation { get; set; }
#endif
}
}

View File

@@ -356,7 +356,11 @@
/// field. The source offsets are relative to the beginning of the page where the
/// fixups are to be made.
/// </remarks>
#if NET48
public ushort[] SourceOffsetList;
#else
public ushort[]? SourceOffsetList;
#endif
#endregion
}

View File

@@ -36,6 +36,10 @@ namespace SabreTools.Models.LinearExecutable
/// This is a variable length string with it's length defined in bytes by
/// the LEN field. The string is case sensitive and is not null terminated.
/// </remarks>
#if NET48
public string Name;
#else
public string? Name;
#endif
}
}

View File

@@ -44,6 +44,10 @@ namespace SabreTools.Models.LinearExecutable
/// This is a variable length string with it's length defined in bytes by
/// the LEN field. The string is case sensitive and is not null terminated.
/// </remarks>
#if NET48
public string Name;
#else
public string? Name;
#endif
}
}

View File

@@ -24,7 +24,11 @@ namespace SabreTools.Models.LinearExecutable
/// The signature word is used by the loader to identify the EXE
/// file as a valid 32-bit Linear Executable Module Format.
/// </remarks>
#if NET48
public string Signature;
#else
public string? Signature;
#endif
/// <summary>
/// Byte Ordering.

View File

@@ -51,7 +51,11 @@ namespace SabreTools.Models.LinearExecutable
/// This is a variable length string with it's length defined in bytes by the LEN field.
/// The string is case case sensitive and is not null terminated.
/// </remarks>
#if NET48
public string Name;
#else
public string? Name;
#endif
/// <summary>
/// Ordinal number.

View File

@@ -51,7 +51,11 @@ namespace SabreTools.Models.LinearExecutable
/// This is a variable length string with it's length defined in bytes by the LEN field.
/// The string is case case sensitive and is not null terminated.
/// </remarks>
#if NET48
public string Name;
#else
public string? Name;
#endif
/// <summary>
/// Ordinal number.