Commit bff6c346 authored by Emmanuele Bassi's avatar Emmanuele Bassi
Browse files

generate: Use the C type name for callback types

We use the identifier for function pointer fields inside structures, but
for callbacks that have a C type, we should use the type name instead.
parent 59ffea64
Pipeline #317629 passed with stage
in 2 minutes and 48 seconds
......@@ -933,6 +933,7 @@ class TemplateFunction:
class TemplateCallback:
def __init__(self, namespace, cb, field=False):
self.name = cb.name
self.type_cname = cb.ctype
self.identifier = cb.name.replace("-", "_")
self.field = field
......@@ -986,7 +987,7 @@ class TemplateCallback:
res += [f"{retval} (* {self.identifier}) ("]
else:
res += [retval]
res += [f"{self.identifier} ("]
res += [f"(* {self.type_cname}) ("]
n_args = len(self.arguments)
if n_args == 0:
res += ["void"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment