[pypy-commit] cffi cffi-1.0: Mark the places that would need proper "const" support
arigo
noreply at buildbot.pypy.org
Fri Mar 8 13:59:42 CET 2013
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1193:d57199d005b4
Date: 2013-03-08 13:54 +0100
http://bitbucket.org/cffi/cffi/changeset/d57199d005b4/
Log: Mark the places that would need proper "const" support
diff --git a/cffi/cparser.py b/cffi/cparser.py
--- a/cffi/cparser.py
+++ b/cffi/cparser.py
@@ -182,6 +182,7 @@
isinstance(decl.type.type.type,
pycparser.c_ast.IdentifierType) and
decl.type.type.type.names == ['__dotdotdot__']):
+ # XXX may contain 'const': decl.type.quals
realtype = model.unknown_ptr_type(decl.name)
else:
realtype = self._get_type(decl.type, name=decl.name)
@@ -190,6 +191,7 @@
raise api.CDefError("unrecognized construct", decl)
def _parse_decl(self, decl):
+ # XXX may contain 'const': decl.quals
node = decl.type
if isinstance(node, pycparser.c_ast.FuncDecl):
tp = self._get_type(node, name=decl.name)
@@ -276,11 +278,13 @@
#
if isinstance(typenode, pycparser.c_ast.PtrDecl):
# pointer type
+ # XXX may list 'const': typenode.quals (e.g. for 'int * const')
const = (isinstance(typenode.type, pycparser.c_ast.TypeDecl)
and 'const' in typenode.type.quals)
return self._get_type_pointer(self._get_type(typenode.type), const)
#
if isinstance(typenode, pycparser.c_ast.TypeDecl):
+ # XXX may list 'const': typenode.quals
type = typenode.type
if isinstance(type, pycparser.c_ast.IdentifierType):
# assume a primitive type. get it from .names, but reduce
More information about the pypy-commit
mailing list