[pypy-svn] r61759 - pypy/trunk/pypy/module/_rawffi

afa at codespeak.net afa at codespeak.net
Wed Feb 11 23:51:38 CET 2009


Author: afa
Date: Wed Feb 11 23:51:36 2009
New Revision: 61759

Modified:
   pypy/trunk/pypy/module/_rawffi/interp_rawffi.py
Log:
Remove the 'v' letter type in _rawffi.
It used to represent a void value, but this is not actually used by _rawffi.

And 'v' is already used by the ctypes.wintypes.VARIANT_BOOL type on Windows.
(I plan to add it shortly)


Modified: pypy/trunk/pypy/module/_rawffi/interp_rawffi.py
==============================================================================
--- pypy/trunk/pypy/module/_rawffi/interp_rawffi.py	(original)
+++ pypy/trunk/pypy/module/_rawffi/interp_rawffi.py	Wed Feb 11 23:51:36 2009
@@ -68,7 +68,6 @@
     'Z' : rffi.CArrayPtr(lltype.UniChar),
     'O' : rffi.VOIDP,
     'P' : rffi.VOIDP,
-    'v' : lltype.Void,
 }
 
 def letter2tp(space, key):
@@ -85,12 +84,10 @@
         raise OperationError(space.w_ValueError, space.wrap(
             "Unknown type letter %s" % (key,)))
     
-def unpack_to_ffi_type(space, w_shape, allow_void=False, shape=False):
+def unpack_to_ffi_type(space, w_shape, shape=False):
     resshape = None
     if space.is_true(space.isinstance(w_shape, space.w_str)):
         letter = space.str_w(w_shape)
-        if allow_void and letter == 'v':
-            return 'v', ffi_type_void, None
         ffi_type = _get_type_(space, letter)
         if shape:
             from pypy.module._rawffi.array import get_array_cache
@@ -122,7 +119,6 @@
     else:
         tp_letter, ffi_restype, resshape = unpack_to_ffi_type(space,
                                                     w_restype,
-                                                    allow_void=True,
                                                     shape=True)
     return ffi_restype, resshape
 
@@ -344,9 +340,6 @@
             if c in TYPEMAP_PTR_LETTERS:
                 res = func(add_arg, argdesc, rffi.VOIDP)
                 return space.wrap(rffi.cast(lltype.Unsigned, res))
-            elif c == 'v':
-                func(add_arg, argdesc, ll_type)
-                return space.w_None
             elif c == 'q' or c == 'Q' or c == 'L' or c == 'c' or c == 'u':
                 return space.wrap(func(add_arg, argdesc, ll_type))
             elif c == 'f' or c == 'd':



More information about the Pypy-commit mailing list