Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r887:b47c74f24438
Date: 2012-08-23 17:49 +0200
http://bitbucket.org/cffi/cffi/changeset/b47c74f24438/

Log:    Also fix vengine_gen.

diff --git a/cffi/vengine_gen.py b/cffi/vengine_gen.py
--- a/cffi/vengine_gen.py
+++ b/cffi/vengine_gen.py
@@ -183,9 +183,7 @@
         prnt('static void %s(%s *p)' % (checkfuncname, cname))
         prnt('{')
         prnt('  /* only to generate compile-time warnings or errors */')
-        for i in range(len(tp.fldnames)):
-            fname = tp.fldnames[i]
-            ftype = tp.fldtypes[i]
+        for fname, ftype, _ in tp.enumfields():
             if (isinstance(ftype, model.PrimitiveType)
                 and ftype.is_integer_type()):
                 # accept all integers, but complain on float or double
@@ -208,7 +206,7 @@
             prnt('  static ssize_t nums[] = {')
             prnt('    1, sizeof(%s),' % cname)
             prnt('    offsetof(struct _cffi_aligncheck, y),')
-            for fname, fbitsize in zip(tp.fldnames, tp.fldbitsize):
+            for fname, _, fbitsize in tp.enumfields():
                 assert fbitsize < 0
                 prnt('    offsetof(%s, %s),' % (cname, fname))
                 prnt('    sizeof(((%s *)0)->%s),' % (cname, fname))
@@ -222,8 +220,7 @@
                 'sizeof(%s) != %d' % (cname, ffi.sizeof(BStruct)),
                 'offsetof(struct _cffi_aligncheck, y) != %d' % (
                     ffi.alignof(BStruct),)]
-            for fname, ftype, fbitsize in zip(tp.fldnames, tp.fldtypes,
-                                              tp.fldbitsize):
+            for fname, ftype, fbitsize in tp.enumfields():
                 if fbitsize >= 0:
                     continue        # xxx ignore fbitsize for now
                 BField = ffi._get_cached_btype(ftype)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to