Alex Gaynor avatar Alex Gaynor committed 0bdcf29 Merge

merged

Comments (0)

Files changed (4)

pypy/rlib/rerased_raw.py

 def ll_enumerate_elements(storage):
     for i, elem in enumerate(storage.shape.chars):
         if elem in [INSTANCE, STRING, UNICODE]:
-            yield storage.data[i].ptr
+            yield storage.data.items[i].ptr
         elif elem == INT:
-            yield rffi.cast(lltype.Signed, storage.data[i])
+            yield rffi.cast(lltype.Signed, storage.data.items[i])
         elif elem == FLOAT:
             yield longlong2float.longlong2float(rffi.cast(lltype.Signed, storage.data[i]))
         elif elem == BOOL:
-            yield rffi.cast(lltype.Bool, storage.data[i])
+            yield rffi.cast(lltype.Bool, storage.data.items[i])
         else:
             assert False

pypy/rlib/test/test_rerased_raw.py

             storage.setbool(2, True)
             return storage
 
-        llres = self.interpret(f, [])
+        llres = self.interpret(f, [])._obj
         lst = list(rerased_raw.ll_enumerate_elements(llres))
         assert hlstr(lst[0]) == "abc"
         assert lst[1:] == [13, True, 3.5]

pypy/translator/c/node.py

 from pypy.rlib import exports
 from pypy.rlib.rfloat import isfinite
 from pypy.rlib.rstackovf import _StackOverflow
-from pypy.rlib.rerased_raw import xxx
+from pypy.rlib.rerased_raw import ll_enumerate_elements
 from pypy.translator.c import extfunc
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from py.builtin import BaseException
             shapefld = [fld for fld in T._flds if fld != arrayfld][0]
             shape = getattr(self.obj, shapefld)
             yield shape
-            for elem in shape.chars:
-                import pdb
-                pdb.set_trace()
-        for name in T._names:
-            yield getattr(self.obj, name)
+            for elem in ll_enumerate_elements(self.obj):
+                yield elem
+        else:
+            for name in T._names:
+                yield getattr(self.obj, name)
 
     def getlength(self):
         T = self.getTYPE()

pypy/translator/c/test/test_untyped_storage.py

 from pypy.translator.c.test.test_genc import compile
 
 class CCompiledMixin(object):
+    # for individual tests see
+    # ===> ../../../rlib/test/test_rerased_raw.py
+    
     def interpret(self, f, args):
         fn = compile(f, [type(arg) for arg in args], gcpolicy='boehm')
         return fn(*args)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.