[pypy-svn] pypy default: Use rffi.getintfield() instead of rffi.cast(), for consistency.

arigo commits-noreply at bitbucket.org
Fri Jan 21 19:07:53 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41173:a34863731865
Date: 2011-01-21 19:07 +0100
http://bitbucket.org/pypy/pypy/changeset/a34863731865/

Log:	Use rffi.getintfield() instead of rffi.cast(), for consistency.

diff --git a/pypy/rpython/module/ll_time.py b/pypy/rpython/module/ll_time.py
--- a/pypy/rpython/module/ll_time.py
+++ b/pypy/rpython/module/ll_time.py
@@ -62,8 +62,8 @@
     setattr(CConfig, const, platform.Defined(const))
 
 def decode_timeval(t):
-    return (float(rffi.cast(lltype.Signed, t.c_tv_sec)) +
-            float(rffi.cast(lltype.Signed, t.c_tv_usec)) * 0.000001)
+    return (float(rffi.getintfield(t, 'c_tv_sec')) +
+            float(rffi.getintfield(t, 'c_tv_usec')) * 0.000001)
 
 class RegisterTime(BaseLazyRegistering):
     def __init__(self):


More information about the Pypy-commit mailing list