[Refactor] Replace byte array initializations with string literals for improved readability

This commit is contained in:
2025-11-24 03:23:37 +00:00
parent 0ddd930ee1
commit 98f52803c9
11 changed files with 15 additions and 33 deletions

View File

@@ -35,6 +35,6 @@ public sealed partial class HPOFS
// Do not translate
const string FS_TYPE = "hpofs";
readonly byte[] _medinfoSignature = "MEDINFO "u8.ToArray();
readonly byte[] _type = [0x48, 0x50, 0x4F, 0x46, 0x53, 0x00, 0x00, 0x00];
readonly byte[] _type = "HPOFS\0\0\0"u8.ToArray();
readonly byte[] _volinfoSignature = "VOLINFO "u8.ToArray();
}

View File

@@ -37,7 +37,5 @@ public sealed partial class QNX4
{
const string FS_TYPE = "qnx4";
readonly byte[] _rootDirFname =
[
0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
];
"/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"u8.ToArray();
}

View File

@@ -35,5 +35,5 @@ public sealed partial class ReFS
const uint FSRS = 0x53525346;
const string FS_TYPE = "refs";
readonly byte[] _signature = [0x52, 0x65, 0x46, 0x53, 0x00, 0x00, 0x00, 0x00];
readonly byte[] _signature = "ReFS\0\0\0\0"u8.ToArray();
}

View File

@@ -36,7 +36,7 @@ public sealed partial class Reiser
const string FS_TYPE = "reiserfs";
readonly byte[] _magic35 = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x46, 0x73, 0x00, 0x00];
readonly byte[] _magic36 = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x32, 0x46, 0x73, 0x00];
readonly byte[] _magicJr = [0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x33, 0x46, 0x73, 0x00];
readonly byte[] _magic35 = "ReIsErFs\0\0"u8.ToArray();
readonly byte[] _magic36 = "ReIsEr2Fs\0"u8.ToArray();
readonly byte[] _magicJr = "ReIsEr3Fs\0"u8.ToArray();
}

View File

@@ -37,7 +37,5 @@ public sealed partial class Reiser4
const string FS_TYPE = "reiser4";
readonly byte[] _magic =
[
0x52, 0x65, 0x49, 0x73, 0x45, 0x72, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
];
"ReIsEr4\0\0\0\0\0\0\0\0\0"u8.ToArray();
}

View File

@@ -38,8 +38,5 @@ public sealed partial class UDF
{
const string FS_TYPE = "udf";
readonly byte[] _magic =
[
0x2A, 0x4F, 0x53, 0x54, 0x41, 0x20, 0x55, 0x44, 0x46, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x6C, 0x69, 0x61, 0x6E,
0x74, 0x00, 0x00, 0x00, 0x00
];
"*OSTA UDF Compliant\0\0\0\0"u8.ToArray();
}