[pypy-svn] r33745 - pypy/dist/pypy/rpython/rctypes
arigo at codespeak.net
arigo at codespeak.net
Thu Oct 26 02:34:48 CEST 2006
Author: arigo
Date: Thu Oct 26 02:34:42 2006
New Revision: 33745
Modified:
pypy/dist/pypy/rpython/rctypes/rmodel.py
Log:
A couple of minor changes ported from the kill-keepalives branch.
Modified: pypy/dist/pypy/rpython/rctypes/rmodel.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/rmodel.py (original)
+++ pypy/dist/pypy/rpython/rctypes/rmodel.py Thu Oct 26 02:34:42 2006
@@ -248,20 +248,13 @@
def rtype_is_true(self, hop):
[v_box] = hop.inputargs(self)
v_value = self.getvalue(hop.llops, v_box)
- if v_value.concretetype == llmemory.Address:
- llfn = ll_address_is_true
- else:
- llfn = ll_is_true
- return hop.gendirectcall(llfn, v_value)
+ return hop.gendirectcall(ll_is_true, v_value)
# ____________________________________________________________
def ll_is_true(x):
return bool(x)
-def ll_address_is_true(x):
- return x != llmemory.NULL
-
C_ZERO = inputconst(lltype.Signed, 0)
def reccopy(source, dest):
@@ -269,9 +262,9 @@
T = lltype.typeOf(source).TO
assert T == lltype.typeOf(dest).TO
if isinstance(T, (lltype.Array, lltype.FixedSizeArray)):
- assert len(source) == len(dest)
+ assert source._obj.getlength() == dest._obj.getlength()
ITEMTYPE = T.OF
- for i in range(len(source)):
+ for i in range(source._obj.getlength()):
if isinstance(ITEMTYPE, lltype.ContainerType):
subsrc = source[i]
subdst = dest[i]
More information about the Pypy-commit
mailing list