[pypy-svn] r50881 - pypy/dist/pypy/rpython/lltypesystem

fijal at codespeak.net fijal at codespeak.net
Tue Jan 22 17:00:36 CET 2008


Author: fijal
Date: Tue Jan 22 17:00:35 2008
New Revision: 50881

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rffi.py
Log:
rffi.getintfield helper, if we don't want to touch lltype magic.


Modified: pypy/dist/pypy/rpython/lltypesystem/rffi.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rffi.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rffi.py	Tue Jan 22 17:00:35 2008
@@ -651,3 +651,10 @@
     assert isinstance(TDST, lltype.Number)
     setattr(pdst, fieldname, cast(TDST, value))
 setintfield._annspecialcase_ = 'specialize:ll_and_arg(1)'
+
+def getintfield(pdst, fieldname):
+    """As temporary as previous: get integer from a field in structure,
+    casting it to lltype.Signed
+    """
+    return cast(lltype.Signed, getattr(pdst, fieldname))
+getintfield._annspecialcase_ = 'specialize:ll_and_arg(1)'



More information about the Pypy-commit mailing list