Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Replace comment marker
  • Loading branch information
youknowone authored Mar 25, 2025
commit 71066c980fc2e37c1ca5062a6e029d04cfa17aa7
12 changes: 6 additions & 6 deletions Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def create_unicode_buffer(init, size=None):
return buf
elif isinstance(init, int):
_sys.audit("ctypes.create_unicode_buffer", None, init)
# XXX: RustPython
# XXX: RUSTPYTHON
# buftype = c_wchar * init
buftype = c_wchar.__mul__(init)
Comment thread
arihant2math marked this conversation as resolved.
buf = buftype()
Expand Down Expand Up @@ -503,11 +503,11 @@ def WinError(code=None, descr=None):
from _ctypes import _memmove_addr, _memset_addr, _string_at_addr, _cast_addr

## void *memmove(void *, const void *, size_t);
# TODO: RUSTPYTHON
# XXX: RUSTPYTHON
# memmove = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_size_t)(_memmove_addr)

## void *memset(void *, int, size_t)
# TODO: RUSTPYTHON
# XXX: RUSTPYTHON
# memset = CFUNCTYPE(c_void_p, c_void_p, c_int, c_size_t)(_memset_addr)

def PYFUNCTYPE(restype, *argtypes):
Expand All @@ -517,12 +517,12 @@ class CFunctionType(_CFuncPtr):
_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
return CFunctionType

# TODO: RUSTPYTHON
# XXX: RUSTPYTHON
# _cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr)
def cast(obj, typ):
return _cast(obj, obj, typ)

# TODO: RUSTPYTHON
# XXX: RUSTPYTHON
# _string_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_string_at_addr)
def string_at(ptr, size=-1):
"""string_at(addr[, size]) -> string
Expand All @@ -535,7 +535,7 @@ def string_at(ptr, size=-1):
except ImportError:
pass
else:
# TODO: RUSTPYTHON
# XXX: RUSTPYTHON
# _wstring_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_wstring_at_addr)
def wstring_at(ptr, size=-1):
"""wstring_at(addr[, size]) -> string
Expand Down
Loading