Author: Matti Picus <[email protected]>
Branch: numpypy.float16
Changeset: r58790:ac1d554efd34
Date: 2012-11-08 13:02 +0200
http://bitbucket.org/pypy/pypy/changeset/ac1d554efd34/

Log:    fix translation

diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -10,7 +10,7 @@
 from pypy.rlib.rawstorage import (alloc_raw_storage, raw_storage_setitem,
                                   raw_storage_getitem)
 from pypy.rlib.objectmodel import specialize
-from pypy.rlib.rarithmetic import widen, byteswap
+from pypy.rlib.rarithmetic import widen, byteswap, intmask
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rlib.rstruct.runpack import runpack
 from pypy.rlib.rstruct.ieee import float_pack, float_unpack
@@ -920,8 +920,7 @@
         return rffi.sizeof(self._STORAGE_T)
 
     def runpack_str(self, s):
-        hbits = rffi.cast(rffi.UINT, runpack('H', s))
-        assert hbits >=0
+        hbits = int(runpack('H', s))
         return self.box(float_unpack(hbits, 2))
 
     def for_computation(self, v):
@@ -931,9 +930,7 @@
         return self.box(-1.0)
 
     def _read(self, storage, i, offset):
-        hbits = rffi.cast(rffi.UINT, 
-                raw_storage_getitem(self._STORAGE_T, storage, i + offset))
-        assert hbits >=0
+        hbits = intmask(raw_storage_getitem(self._STORAGE_T, storage, i + 
offset))
         return float_unpack(hbits, 2)
 
     def _write(self, storage, i, offset, value):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to