[pypy-svn] commit/pypy: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Mon Dec 20 12:34:37 CET 2010
2 new changesets in pypy:
http://bitbucket.org/pypy/pypy/changeset/c4db19b270df/
changeset: r40137:c4db19b270df
branch: jitypes2
user: antocuni
date: 2010-12-20 12:32:16
summary: improve the comment
affected #: 1 file (35 bytes)
--- a/lib_pypy/_ctypes/basics.py Mon Dec 13 17:25:44 2010 +0100
+++ b/lib_pypy/_ctypes/basics.py Mon Dec 20 12:32:16 2010 +0100
@@ -150,7 +150,7 @@
return pointer(cdata)
def cdata_from_address(self, address):
- # fix the address, in case it's unsigned
+ # fix the address: turn it into as unsigned, in case it's a negative number
address = address & (sys.maxint * 2 + 1)
instance = self.__new__(self)
lgt = getattr(self, '_length_', 1)
http://bitbucket.org/pypy/pypy/changeset/28164bffd652/
changeset: r40138:28164bffd652
branch: jitypes2
user: antocuni
date: 2010-12-20 12:34:10
summary: correctly handle pointers as results. This makes test_functions.test_pointers passing
affected #: 1 file (196 bytes)
--- a/lib_pypy/_ctypes/function.py Mon Dec 20 12:32:16 2010 +0100
+++ b/lib_pypy/_ctypes/function.py Mon Dec 20 12:34:10 2010 +0100
@@ -420,7 +420,11 @@
if result == 0:
result = None
else:
- assert False, 'TODO'
+ # XXX: I could not find a more direct way to create a pointer
+ # to this specific address
+ address = result
+ result = restype()
+ result._buffer[0] = address
elif restype._ffishape == 'z':
result = restype(result).value # XXX: maybe it's the general way to do it?
return result
Repository URL: https://bitbucket.org/pypy/pypy/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the Pypy-commit
mailing list