File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ def get(self: c_int) -> int:
2222 def _set (self : c_int , value : int ) -> None :
2323 """Set the value of the integer to the given value."""
2424 self .memory [self .address : self .address + self .size ] = value .to_bytes (self .size , self .endianness , signed = True )
25+
26+ def __int__ (self : c_int ) -> int :
27+ """Return the value of the integer."""
28+ return self .get ()
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ def get(self: c_long) -> int:
2222 def _set (self : c_long , value : int ) -> None :
2323 """Set the value of the integer to the given value."""
2424 self .memory [self .address : self .address + self .size ] = value .to_bytes (self .size , self .endianness , signed = True )
25+
26+ def __int__ (self : c_long ) -> int :
27+ """Return the value of the integer."""
28+ return self .get ()
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ def get(self: c_uint) -> int:
2222 def _set (self : c_uint , value : int ) -> None :
2323 """Set the value of the integer to the given value."""
2424 self .memory [self .address : self .address + self .size ] = value .to_bytes (self .size , self .endianness , signed = False )
25+
26+ def __int__ (self : c_uint ) -> int :
27+ """Return the value of the integer."""
28+ return self .get ()
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ def get(self: c_ulong) -> int:
2222 def _set (self : c_ulong , value : int ) -> None :
2323 """Set the value of the integer to the given value."""
2424 self .memory [self .address : self .address + self .size ] = value .to_bytes (self .size , self .endianness , signed = False )
25+
26+ def __int__ (self : c_ulong ) -> int :
27+ """Return the value of the integer."""
28+ return self .get ()
You can’t perform that action at this time.
0 commit comments