Author: Alex Gaynor <[email protected]>
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
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit