diff options
author | Armin Rigo <arigo@tunes.org> | 2015-04-24 10:13:35 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-04-24 10:13:35 +0200 |
commit | 2e741e2cd478b4fead808517b1cfd2313f7a0139 (patch) | |
tree | aa6e1be1c18d9045372c551349feebd29ec1cc61 /cffi/model.py | |
parent | 8d7463f0e3718a36ffb72c618b47ab147cd1a1c5 (diff) | |
parent | 391504bcc38a40a31f7e6cb41d771d521b79def5 (diff) | |
download | cffi-2e741e2cd478b4fead808517b1cfd2313f7a0139.tar.gz |
hg merge default
Diffstat (limited to 'cffi/model.py')
-rw-r--r-- | cffi/model.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cffi/model.py b/cffi/model.py index 5ba26b8..2bf8db9 100644 --- a/cffi/model.py +++ b/cffi/model.py @@ -179,6 +179,9 @@ class FunctionPtrType(BaseFunctionType): return global_cache(self, ffi, 'new_function_type', tuple(args), result, self.ellipsis) + def as_raw_function(self): + return RawFunctionType(self.args, self.result, self.ellipsis) + class PointerType(BaseType): _attrs_ = ('totype',) @@ -229,7 +232,7 @@ class ArrayType(BaseType): elif length == '...': brackets = '&[/*...*/]' else: - brackets = '&[%d]' % length + brackets = '&[%s]' % length self.c_name_with_marker = ( self.item.c_name_with_marker.replace('&', brackets)) @@ -461,11 +464,12 @@ def unknown_type(name, structname=None): structname = '$%s' % name tp = StructType(structname, None, None, None) tp.force_the_name(name) + tp.origin = "unknown_type" return tp def unknown_ptr_type(name, structname=None): if structname is None: - structname = '*$%s' % name + structname = '$$%s' % name tp = StructType(structname, None, None, None) return NamedPointerType(tp, name) |