Skip to content

Commit 0191708

Browse files
authored
Small cleanup (#162)
1 parent 7678a8f commit 0191708

18 files changed

Lines changed: 106 additions & 104 deletions

dissect/cstruct/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from dissect.cstruct.bitbuffer import BitBuffer
44
from dissect.cstruct.cstruct import cstruct, ctypes, ctypes_type
5-
from dissect.cstruct.exceptions import (
5+
from dissect.cstruct.exception import (
66
Error,
77
NullPointerDereference,
88
ParserError,
@@ -28,7 +28,7 @@
2828
Wchar,
2929
WcharArray,
3030
)
31-
from dissect.cstruct.utils import (
31+
from dissect.cstruct.util import (
3232
dumpstruct,
3333
hexdump,
3434
p8,

dissect/cstruct/cstruct.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pathlib import Path
99
from typing import TYPE_CHECKING, Any, BinaryIO, TypeVar, cast
1010

11-
from dissect.cstruct.exceptions import ResolveError
11+
from dissect.cstruct.exception import ResolveError
1212
from dissect.cstruct.expression import Expression
1313
from dissect.cstruct.parser import CStyleParser
1414
from dissect.cstruct.types import (
@@ -171,15 +171,16 @@ def __init__(self, load: str = "", *, endian: str = "<", pointer: str | None = N
171171
"_OWORD": "uint128",
172172

173173
# Other convenience types
174-
"u1": "uint8",
175-
"u2": "uint16",
176-
"u4": "uint32",
177-
"u8": "uint64",
178-
"u16": "uint128",
174+
"u8": "uint8",
175+
"u16": "uint16",
176+
"u32": "uint32",
177+
"u64": "uint64",
178+
"u128": "uint128",
179179
"__u8": "uint8",
180180
"__u16": "uint16",
181181
"__u32": "uint32",
182182
"__u64": "uint64",
183+
"__u128": "uint128",
183184
"uchar": "uint8",
184185
"ushort": "uint16",
185186
"uint": "uint32",
@@ -583,15 +584,16 @@ class void(Void): ...
583584
_QWORD: TypeAlias = uint64
584585
_OWORD: TypeAlias = uint128
585586

586-
u1: TypeAlias = uint8
587-
u2: TypeAlias = uint16
588-
u4: TypeAlias = uint32
589-
u8: TypeAlias = uint64
590-
u16: TypeAlias = uint128
587+
u8: TypeAlias = uint8
588+
u16: TypeAlias = uint16
589+
u32: TypeAlias = uint32
590+
u64: TypeAlias = uint64
591+
u128: TypeAlias = uint128
591592
__u8: TypeAlias = uint8
592593
__u16: TypeAlias = uint16
593594
__u32: TypeAlias = uint32
594595
__u64: TypeAlias = uint64
596+
__u128: TypeAlias = uint128
595597
uchar: TypeAlias = uint8
596598
ushort: TypeAlias = uint16
597599
uint: TypeAlias = uint32

dissect/cstruct/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from typing import TYPE_CHECKING
44

5-
from dissect.cstruct.exceptions import ExpressionParserError
5+
from dissect.cstruct.exception import ExpressionParserError
66
from dissect.cstruct.lexer import IDENTIFIER_TYPES, Lexer, TokenCursor, TokenType
7-
from dissect.cstruct.utils import offsetof, sizeof
7+
from dissect.cstruct.util import offsetof, sizeof
88

99
if TYPE_CHECKING:
1010
from collections.abc import Callable

dissect/cstruct/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import re
55
from typing import TYPE_CHECKING
66

7-
from dissect.cstruct.exceptions import LexerError
7+
from dissect.cstruct.exception import LexerError
88

99
if TYPE_CHECKING:
1010
from collections.abc import Callable

dissect/cstruct/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import TYPE_CHECKING
66

77
from dissect.cstruct import compiler
8-
from dissect.cstruct.exceptions import (
8+
from dissect.cstruct.exception import (
99
ExpressionParserError,
1010
LexerError,
1111
ParserError,

dissect/cstruct/types/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from io import BytesIO
55
from typing import TYPE_CHECKING, Any, BinaryIO, ClassVar, TypeVar
66

7-
from dissect.cstruct.exceptions import ArraySizeError
7+
from dissect.cstruct.exception import ArraySizeError
88
from dissect.cstruct.expression import Expression
99

1010
if TYPE_CHECKING:

dissect/cstruct/types/int.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import TYPE_CHECKING, Any, BinaryIO
44

55
from dissect.cstruct.types.base import BaseType
6-
from dissect.cstruct.utils import ENDIANNESS_MAP
6+
from dissect.cstruct.util import ENDIANNESS_MAP
77

88
if TYPE_CHECKING:
99
from typing_extensions import Self

dissect/cstruct/types/pointer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import TYPE_CHECKING, Any, BinaryIO, Generic, TypeVar
44

5-
from dissect.cstruct.exceptions import NullPointerDereference
5+
from dissect.cstruct.exception import NullPointerDereference
66
from dissect.cstruct.types.base import BaseType
77
from dissect.cstruct.types.char import Char
88
from dissect.cstruct.types.void import Void

0 commit comments

Comments
 (0)