Redo Reformat and cleanup.

Rider EAP was having a bug interpreting .editorconfig that didn't generate the code style as we wanted.
This is now done with Rider-stable.
This commit is contained in:
2023-10-04 17:34:40 +01:00
parent bc8bf7a2dc
commit 7363a5d9c5
453 changed files with 7241 additions and 7126 deletions

View File

@@ -51,12 +51,10 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
if(!string.IsNullOrEmpty(path) &&
string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
if(!string.IsNullOrEmpty(path) && string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) != 0)
return ErrorNumber.NotSupported;
var contents = _fileEntries.Select(ent => StringHandlers.PascalToString(ent.Filename, _encoding)).
ToList();
var contents = _fileEntries.Select(ent => StringHandlers.PascalToString(ent.Filename, _encoding)).ToList();
if(_debug)
{

View File

@@ -48,7 +48,10 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[]
{
'/'
}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -71,15 +74,19 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[]
{
'/'
}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
byte[] file;
if(_debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0))
if(_debug &&
(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0))
file = string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ? _catalogBlocks : _bootBlocks;
else
{
@@ -133,8 +140,7 @@ public sealed partial class PascalPlugin
if(!_mounted)
return ErrorNumber.AccessDenied;
if(buffer is null ||
buffer.Length < length)
if(buffer is null || buffer.Length < length)
return ErrorNumber.InvalidArgument;
if(node is not PascalFileNode mynode)
@@ -156,7 +162,10 @@ public sealed partial class PascalPlugin
{
stat = null;
string[] pathElements = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
string[] pathElements = path.Split(new[]
{
'/'
}, StringSplitOptions.RemoveEmptyEntries);
if(pathElements.Length != 1)
return ErrorNumber.NotSupported;
@@ -218,7 +227,8 @@ public sealed partial class PascalPlugin
StringHandlers.PascalToString(ent.Filename,
_encoding),
StringComparison.
InvariantCultureIgnoreCase) == 0))
InvariantCultureIgnoreCase) ==
0))
{
entry = ent;

View File

@@ -104,8 +104,7 @@ public sealed partial class PascalPlugin
return false;
// Volume record entry type must be volume or secure
if(volEntry.EntryType != PascalFileKind.Volume &&
volEntry.EntryType != PascalFileKind.Secure)
if(volEntry.EntryType != PascalFileKind.Volume && volEntry.EntryType != PascalFileKind.Secure)
return false;
// Volume name is max 7 characters
@@ -113,8 +112,7 @@ public sealed partial class PascalPlugin
return false;
// Volume blocks is equal to volume sectors
if(volEntry.Blocks < 0 ||
(ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
if(volEntry.Blocks < 0 || (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
return false;
// There can be not less than zero files
@@ -171,8 +169,7 @@ public sealed partial class PascalPlugin
return;
// Volume record entry type must be volume or secure
if(volEntry.EntryType != PascalFileKind.Volume &&
volEntry.EntryType != PascalFileKind.Secure)
if(volEntry.EntryType != PascalFileKind.Volume && volEntry.EntryType != PascalFileKind.Secure)
return;
// Volume name is max 7 characters
@@ -180,8 +177,7 @@ public sealed partial class PascalPlugin
return;
// Volume blocks is equal to volume sectors
if(volEntry.Blocks < 0 ||
(ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
if(volEntry.Blocks < 0 || (ulong)volEntry.Blocks != imagePlugin.Info.Sectors / _multiplier)
return;
// There can be not less than zero files
@@ -189,7 +185,8 @@ public sealed partial class PascalPlugin
return;
sbInformation.AppendFormat(Localization.Volume_record_spans_from_block_0_to_block_1, volEntry.FirstBlock,
volEntry.LastBlock).AppendLine();
volEntry.LastBlock).
AppendLine();
sbInformation.
AppendFormat(Localization.Volume_name_0, StringHandlers.PascalToString(volEntry.VolumeName, encoding)).

View File

@@ -87,14 +87,13 @@ public sealed partial class PascalPlugin
_mountedVolEntry.LastBoot = BigEndianBitConverter.ToInt16(_catalogBlocks, 0x14);
_mountedVolEntry.Tail = BigEndianBitConverter.ToInt32(_catalogBlocks, 0x16);
if(_mountedVolEntry.FirstBlock != 0 ||
_mountedVolEntry.LastBlock <= _mountedVolEntry.FirstBlock ||
(ulong)_mountedVolEntry.LastBlock > _device.Info.Sectors / _multiplier - 2 ||
_mountedVolEntry.EntryType != PascalFileKind.Volume &&
_mountedVolEntry.EntryType != PascalFileKind.Secure ||
_mountedVolEntry.VolumeName[0] > 7 ||
_mountedVolEntry.Blocks < 0 ||
(ulong)_mountedVolEntry.Blocks != _device.Info.Sectors / _multiplier ||
if(_mountedVolEntry.FirstBlock != 0 ||
_mountedVolEntry.LastBlock <= _mountedVolEntry.FirstBlock ||
(ulong)_mountedVolEntry.LastBlock > _device.Info.Sectors / _multiplier - 2 ||
_mountedVolEntry.EntryType != PascalFileKind.Volume && _mountedVolEntry.EntryType != PascalFileKind.Secure ||
_mountedVolEntry.VolumeName[0] > 7 ||
_mountedVolEntry.Blocks < 0 ||
(ulong)_mountedVolEntry.Blocks != _device.Info.Sectors / _multiplier ||
_mountedVolEntry.Files < 0)
return ErrorNumber.InvalidArgument;
@@ -123,8 +122,7 @@ public sealed partial class PascalPlugin
Array.Copy(_catalogBlocks, offset + 0x06, entry.Filename, 0, 16);
if(entry.Filename[0] <= 15 &&
entry.Filename[0] > 0)
if(entry.Filename[0] <= 15 && entry.Filename[0] > 0)
_fileEntries.Add(entry);
offset += 26;

View File

@@ -100,6 +100,8 @@ public sealed partial class PascalPlugin : IReadOnlyFilesystem
static Dictionary<string, string> GetDefaultOptions() => new()
{
{ "debug", false.ToString() }
{
"debug", false.ToString()
}
};
}