2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00

Nullable Attributes

This commit is contained in:
2022-04-03 02:19:00 +03:00
parent 2809d389bd
commit 86db6864f1
5 changed files with 213 additions and 48 deletions

View File

@ -222,7 +222,7 @@ public struct TransmissionType
ulong cl = (ulong)(1 << (exp -1));
if (ends - offset < cl)
return (ends - offset - (uint)cl, null);
return (cl - (ends - offset), null);
//offset += (uint)cl;
@ -233,13 +233,16 @@ public struct TransmissionType
ulong cll = (ulong)(h >> 3) & 0x7;
if (ends - offset < cll)
return (ends - offset - (uint)cll, null);
return (cll - (ends - offset), null);
ulong cl = 0;
for (uint i = 0; i < cll; i++)
cl = cl << 8 | data[offset++];
if (ends - offset < cl)
return (cl - (ends - offset), null);
return (1 + cl + cll, new TransmissionType((TransmissionTypeIdentifier)(h & 0xC7), cls, h & 0x7, offset, cl));
}
}