Device: Re-use magic reference across Structures

This commit is contained in:
rlaphoenix 2022-07-21 16:23:19 +01:00
parent f2174dfa72
commit 70e79825b3
1 changed files with 5 additions and 3 deletions

View File

@ -23,13 +23,15 @@ class _Types(Enum):
class _Structures:
magic = Const(b"WVD")
header = Struct(
"signature" / Const(b"WVD"),
"signature" / magic,
"version" / Int8ub
)
v2 = Struct(
"signature" / Const(b"WVD"),
"signature" / magic,
"version" / Const(Int8ub, 2),
"type_" / CEnum(
Int8ub,
@ -47,7 +49,7 @@ class _Structures:
)
v1 = Struct(
"signature" / Const(b"WVD"),
"signature" / magic,
"version" / Const(Int8ub, 1),
"type_" / CEnum(
Int8ub,