[pypy-commit] pypy py3k: Mostly fix translation on freebsd. A failure still happens late in translation, but rtyping works at least.
marky1991
pypy.commits at gmail.com
Thu Aug 11 11:49:26 EDT 2016
Author: Mark Young <marky1991 at gmail.com>
Branch: py3k
Changeset: r86148:2d01427fae77
Date: 2016-08-02 18:57 +0000
http://bitbucket.org/pypy/pypy/changeset/2d01427fae77/
Log: Mostly fix translation on freebsd. A failure still happens late in
translation, but rtyping works at least.
diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -1022,7 +1022,10 @@
with lltype.scoped_alloc(rposix.TMS) as tms:
ret = rposix.c_times(tms)
if rffi.cast(lltype.Signed, ret) != -1:
- cpu_time = float(tms.c_tms_utime + tms.c_tms_stime)
+ cpu_time = float(rffi.cast(lltype.Signed,
+ tms.c_tms_utime) +
+ rffi.cast(lltype.Signed,
+ tms.c_tms_stime))
if w_info is not None:
_setinfo(space, w_info, "times()",
1.0 / rposix.CLOCK_TICKS_PER_SECOND,
@@ -1044,7 +1047,7 @@
pass
value = _clock()
# Is this casting correct?
- if value == rffi.cast(rposix.CLOCK_T, -1):
+ if intmask(value) == intmask(rffi.cast(rposix.CLOCK_T, -1)):
raise oefmt(space.w_RuntimeError,
"the processor time used is not available or its value"
"cannot be represented")
More information about the pypy-commit
mailing list