Author: Armin Rigo <[email protected]>
Branch: cffi-1.0
Changeset: r1755:3ccb4668ee1f
Date: 2015-04-18 13:35 +0200
http://bitbucket.org/cffi/cffi/changeset/3ccb4668ee1f/

Log:    Generate more comments

diff --git a/new/recompiler.py b/new/recompiler.py
--- a/new/recompiler.py
+++ b/new/recompiler.py
@@ -118,8 +118,12 @@
         #
         # the declaration of '_cffi_types'
         prnt('static void *_cffi_types[] = {')
+        typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()])
         for i, op in enumerate(self.cffi_types):
-            prnt('/* %2d */ %s,' % (i, op.as_c_expr()))
+            comment = ''
+            if i in typeindex2type:
+                comment = ' // ' + typeindex2type[i]._get_c_name()
+            prnt('/* %2d */ %s,%s' % (i, op.as_c_expr(), comment))
         if not self.cffi_types:
             prnt('  0')
         prnt('};')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to