summaryrefslogtreecommitdiff
path: root/python_modules
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2018-06-21 22:54:47 +0100
committerFrediano Ziglio <fziglio@redhat.com>2019-02-20 17:42:59 +0000
commit7462c171e1717e3bd2b84c04a8d8c4c12ecb23fb (patch)
treeb45f10b7065b19e1df94c4332b21580f268c767e /python_modules
parent53c0c5a665bb32698de9545cbdf0f496f0cfe06b (diff)
codegen: Fix c_type result for TypeAlias
c_type() method is supposed to return the type to use for C structure field. But the name is not a C type but a protocol name. Return the type name of the aliased type (for instance uint32_t for a uint32 type). This does not change the generated code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'python_modules')
-rw-r--r--python_modules/ptypes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 162c4d7..da148e8 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -246,7 +246,7 @@ class TypeAlias(Type):
def c_type(self):
if self.has_attr("ctype"):
return self.attributes["ctype"][0]
- return self.name
+ return self.the_type.c_type()
class EnumBaseType(Type):
def is_enum(self):