[pypy-svn] pypy real-rffi.INT: Translation fixes. Now it fails in rtyping phase!

amauryfa commits-noreply at bitbucket.org
Thu Mar 3 19:27:27 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: real-rffi.INT
Changeset: r42412:7b463bc54073
Date: 2011-03-03 19:26 +0100
http://bitbucket.org/pypy/pypy/changeset/7b463bc54073/

Log:	Translation fixes. Now it fails in rtyping phase!

diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -349,9 +349,12 @@
                 elif cmd == _c.SIO_KEEPALIVE_VALS:
                     w_onoff, w_time, w_interval = space.unpackiterable(w_option)
                     option_ptr = rffi.cast(lltype.Ptr(_c.tcp_keepalive), value_ptr)
-                    option_ptr.c_onoff = space.uint_w(w_onoff)
-                    option_ptr.c_keepalivetime = space.uint_w(w_time)
-                    option_ptr.c_keepaliveinterval = space.uint_w(w_interval)
+                    rffi.setintfield(option_ptr, 'c_onoff',
+                                     space.uint_w(w_onoff))
+                    rffi.setintfield(option_ptr, 'c_keepalivetime',
+                                     space.uint_w(w_time))
+                    rffi.setintfield(option_ptr, 'c_keepaliveinterval',
+                                     space.uint_w(w_interval))
 
                 res = _c.WSAIoctl(
                     self.fd, cmd, value_ptr, value_size,

diff --git a/pypy/rpython/module/ll_os.py b/pypy/rpython/module/ll_os.py
--- a/pypy/rpython/module/ll_os.py
+++ b/pypy/rpython/module/ll_os.py
@@ -9,7 +9,7 @@
 import py
 from pypy.rpython.module.support import ll_strcpy, OOSupport
 from pypy.tool.sourcetools import func_with_new_name, func_renamer
-from pypy.rlib.rarithmetic import r_longlong
+from pypy.rlib.rarithmetic import r_longlong, r_uint
 from pypy.rpython.extfunc import (
     BaseLazyRegistering, lazy_register, register_external)
 from pypy.rpython.extfunc import registering, registering_if, extdef
@@ -1733,7 +1733,7 @@
 
         @registering(rwin32.FormatError)
         def register_rwin32_FormatError(self):
-            return extdef([rwin32.DWORD], str,
+            return extdef([r_uint], str,
                           "rwin32_FormatError",
                           llimpl=rwin32.llimpl_FormatError,
                           ooimpl=rwin32.fake_FormatError)

diff --git a/pypy/module/_winreg/interp_winreg.py b/pypy/module/_winreg/interp_winreg.py
--- a/pypy/module/_winreg/interp_winreg.py
+++ b/pypy/module/_winreg/interp_winreg.py
@@ -256,7 +256,7 @@
                 if ret == rwinreg.ERROR_MORE_DATA:
                     # Resize and retry
                     bufSize *= 2
-                    bufsize_p[0] = bufSize
+                    bufsize_p[0] = rffi.cast(rwin32.LONG, bufSize)
                     continue
 
                 if ret != 0:

diff --git a/pypy/rlib/rmmap.py b/pypy/rlib/rmmap.py
--- a/pypy/rlib/rmmap.py
+++ b/pypy/rlib/rmmap.py
@@ -540,7 +540,7 @@
             FILE_BEGIN = 0
             high_ref = lltype.malloc(PLONG.TO, 1, flavor='raw')
             try:
-                high_ref[0] = newsize_high
+                high_ref[0] = rffi.cast(LONG, newsize_high)
                 SetFilePointer(self.file_handle, newsize_low, high_ref,
                                FILE_BEGIN)
             finally:


More information about the Pypy-commit mailing list