Skip to content

Commit

Permalink
Fix some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Aug 8, 2024
1 parent 86a4a77 commit 0ca6058
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions decompiler/structures/pseudo/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
_T = TypeVar("_T", bound="Type")


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class Type(ABC):
"""Base interface for all type classes."""

Expand All @@ -29,20 +29,20 @@ def __str__(self) -> str:
"""Every type should provide a c-like string representation."""


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class UnknownType(Type):
"""Represent an unknown type, mostly utilized for testing purposes."""

def __init__(self, size: int = 0):
"""Create a type with size 0."""
Type.__init__(self, size=size)
object.__setattr__(self, "size", size)

def __str__(self):
"""Return the representation of the unknown type."""
return "unknown type"


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class Integer(Type):
"""Type for values representing numbers."""

Expand Down Expand Up @@ -121,7 +121,7 @@ def __str__(self):
return f"{'u' if not self.is_signed else ''}int{self.size}_t"


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class Float(Type):
"""Class representing the type of a floating point number as defined in IEEE 754."""

Expand All @@ -142,7 +142,7 @@ def __str__(self) -> str:
return self.SIZE_TYPES[self.size]


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class Pointer(Type):
"""Class representing types based on being pointers on other types."""

Expand All @@ -160,7 +160,7 @@ def __str__(self) -> str:
return f"{self.type} *"


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class ArrayType(Type):
"""Class representing arrays."""

Expand All @@ -182,7 +182,7 @@ def __str__(self) -> str:
return f"{self.type} [{self.elements}]"


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class CustomType(Type):
"""Class representing a non-basic type."""

Expand Down Expand Up @@ -218,7 +218,7 @@ def __str__(self) -> str:
return self.text


@dataclass(frozen=True, order=True, slots=False)
@dataclass(frozen=True, order=True)
class FunctionTypeDef(Type):
return_type: Type
parameters: Tuple[Type, ...]
Expand Down

0 comments on commit 0ca6058

Please sign in to comment.