[pypy-commit] pypy numpy-dtype-refactor: merged default in

alex_gaynor noreply at buildbot.pypy.org
Fri Nov 11 17:50:01 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-refactor
Changeset: r49332:d5a2cb285c1d
Date: 2011-11-11 11:41 -0500
http://bitbucket.org/pypy/pypy/changeset/d5a2cb285c1d/

Log:	merged default in

diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -1163,6 +1163,8 @@
         value = value.adr
     if isinstance(value, llmemory.fakeaddress):
         value = value.ptr or 0
+    if isinstance(value, r_singlefloat):
+        value = float(value)
     TYPE1 = lltype.typeOf(value)
     cvalue = lltype2ctypes(value)
     cresulttype = get_ctypes_type(RESTYPE)
diff --git a/pypy/rpython/lltypesystem/test/test_rffi.py b/pypy/rpython/lltypesystem/test/test_rffi.py
--- a/pypy/rpython/lltypesystem/test/test_rffi.py
+++ b/pypy/rpython/lltypesystem/test/test_rffi.py
@@ -710,6 +710,9 @@
         res = cast(lltype.SingleFloat, res)
         assert res == r_singlefloat(12.3)
 
+        res = cast(lltype.Float, r_singlefloat(12.))
+        assert res == 12.
+
     def test_rffi_sizeof(self):
         try:
             import ctypes


More information about the pypy-commit mailing list