[pypy-svn] pypy jitypes2: rename _ffi.types.pointer to void_p, to underline that it is a untyped pointer
antocuni
commits-noreply at bitbucket.org
Fri Mar 25 15:07:38 CET 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r42934:24e432f3c808
Date: 2011-03-25 12:21 +0100
http://bitbucket.org/pypy/pypy/changeset/24e432f3c808/
Log: rename _ffi.types.pointer to void_p, to underline that it is a
untyped pointer
diff --git a/pypy/module/_ffi/test/test__ffi.py b/pypy/module/_ffi/test/test__ffi.py
--- a/pypy/module/_ffi/test/test__ffi.py
+++ b/pypy/module/_ffi/test/test__ffi.py
@@ -148,9 +148,9 @@
from _ffi import CDLL, types
libfoo = CDLL(self.libfoo_name)
get_dummy = libfoo.getfunc('get_dummy', [], types.sint)
- get_dummy_ptr = libfoo.getfunc('get_dummy_ptr', [], types.pointer)
+ get_dummy_ptr = libfoo.getfunc('get_dummy_ptr', [], types.void_p)
set_val_to_ptr = libfoo.getfunc('set_val_to_ptr',
- [types.pointer, types.sint],
+ [types.void_p, types.sint],
types.void)
assert get_dummy() == 0
ptr = get_dummy_ptr()
@@ -170,14 +170,14 @@
def __init__(self, value):
self.value = value
def _as_ffi_pointer_(self, ffitype):
- assert ffitype is types.pointer
+ assert ffitype is types.void_p
return self.value
libfoo = CDLL(self.libfoo_name)
get_dummy = libfoo.getfunc('get_dummy', [], types.sint)
- get_dummy_ptr = libfoo.getfunc('get_dummy_ptr', [], types.pointer)
+ get_dummy_ptr = libfoo.getfunc('get_dummy_ptr', [], types.void_p)
set_val_to_ptr = libfoo.getfunc('set_val_to_ptr',
- [types.pointer, types.sint],
+ [types.void_p, types.sint],
types.void)
assert get_dummy() == 0
ptr = get_dummy_ptr()
@@ -222,7 +222,7 @@
import sys
from _ffi import CDLL, types
libfoo = CDLL(self.libfoo_name)
- is_null_ptr = libfoo.getfunc('is_null_ptr', [types.pointer], types.ulong)
+ is_null_ptr = libfoo.getfunc('is_null_ptr', [types.void_p], types.ulong)
assert not is_null_ptr(sys.maxint+1)
def test_unsigned_long_args(self):
diff --git a/pypy/module/_ffi/interp_ffi.py b/pypy/module/_ffi/interp_ffi.py
--- a/pypy/module/_ffi/interp_ffi.py
+++ b/pypy/module/_ffi/interp_ffi.py
@@ -104,7 +104,7 @@
W_FFIType('double', libffi.types.double),
W_FFIType('float', libffi.types.float),
W_FFIType('void', libffi.types.void),
- W_FFIType('pointer', libffi.types.pointer),
+ W_FFIType('void_p', libffi.types.pointer),
#
# missing types:
More information about the Pypy-commit
mailing list