[pypy-commit] pypy kqueue: Correct use of integer types.

oberstet noreply at buildbot.pypy.org
Sun Mar 4 20:39:39 CET 2012


Author: Tobias Oberstein <tobias.oberstein at gmail.com>
Branch: kqueue
Changeset: r53203:5c06272fbaa9
Date: 2012-03-04 16:57 +0100
http://bitbucket.org/pypy/pypy/changeset/5c06272fbaa9/

Log:	Correct use of integer types.

diff --git a/pypy/module/select/interp_kqueue.py b/pypy/module/select/interp_kqueue.py
--- a/pypy/module/select/interp_kqueue.py
+++ b/pypy/module/select/interp_kqueue.py
@@ -20,11 +20,11 @@
 
 
 CConfig.kevent = rffi_platform.Struct("struct kevent", [
-    ("ident", rffi.SIZE_T), # uintptr_t
+    ("ident", rffi.UINTPTR_T),
     ("filter", rffi.SHORT),
     ("flags", rffi.USHORT),
     ("fflags", rffi.UINT),
-    ("data", rffi.SSIZE_T), # intptr_t
+    ("data", rffi.INTPTR_T),
     ("udata", rffi.VOIDP),
 ])
 
@@ -227,7 +227,7 @@
         if self.event:
             lltype.free(self.event, flavor="raw")
 
-    @unwrap_spec(filter=int, flags=int, fflags=rffi.r_uint, data=int, udata=rffi.r_uint)
+    @unwrap_spec(filter=int, flags=rffi.r_uint, fflags=rffi.r_uint, data=int, udata=rffi.r_uint)
     def descr__init__(self, space, w_ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0):
         ident = space.c_filedescriptor_w(w_ident)
 
diff --git a/pypy/rpython/lltypesystem/rffi.py b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -433,7 +433,8 @@
         TYPES.append(name)
 TYPES += ['signed char', 'unsigned char',
           'long long', 'unsigned long long',
-          'size_t', 'time_t', 'wchar_t']
+          'size_t', 'time_t', 'wchar_t',
+          'uintptr_t', 'intptr_t']
 if os.name != 'nt':
     TYPES.append('mode_t')
     TYPES.append('pid_t')
@@ -617,8 +618,6 @@
 # (use SIGNEDCHAR or UCHAR for the small integer types)
 CHAR = lltype.Char
 
-INTPTR_T = SSIZE_T
-
 # double
 DOUBLE = lltype.Float
 LONGDOUBLE = lltype.LongFloat


More information about the pypy-commit mailing list