[pypy-commit] pypy numpy-record-dtypes: slightly cleaner

alex_gaynor noreply at buildbot.pypy.org
Sun Mar 4 04:47:57 CET 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-record-dtypes
Changeset: r53169:7e4c821d088f
Date: 2012-03-03 22:47 -0500
http://bitbucket.org/pypy/pypy/changeset/7e4c821d088f/

Log:	slightly cleaner

diff --git a/pypy/rlib/rarithmetic.py b/pypy/rlib/rarithmetic.py
--- a/pypy/rlib/rarithmetic.py
+++ b/pypy/rlib/rarithmetic.py
@@ -521,9 +521,8 @@
     from pypy.rpython.lltypesystem import lltype, rffi
     
     T = lltype.typeOf(arg)
-    if T != rffi.LONGLONG and T != rffi.ULONGLONG and T != rffi.UINT:
-        arg = rffi.cast(lltype.Signed, arg)
-        # XXX we cannot do arithmetics on small ints
+    # XXX we cannot do arithmetics on small ints
+    arg = widen(arg)
     if rffi.sizeof(T) == 1:
         res = arg
     elif rffi.sizeof(T) == 2:


More information about the pypy-commit mailing list