summaryrefslogtreecommitdiff
path: root/utils/codegen/ipc
diff options
context:
space:
mode:
authorBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-05-13 15:00:07 +0200
committerBarnabás Pőcze <barnabas.pocze@ideasonboard.com>2025-05-27 11:10:23 +0200
commite633d85be9bdf179233ee2cc677ec3edac6df168 (patch)
treecff35991f527cc4a38a57f361039155a346d2b4d /utils/codegen/ipc
parent4adefc100de9f2fac08ff7f5003d5910290d331f (diff)
utils: codegen: ipc: Simplify `return` statements
Returning an expression of type `void` from a function returning `void` is legal, so do not handle those cases specially. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'utils/codegen/ipc')
-rw-r--r--utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl10
1 files changed, 4 insertions, 6 deletions
diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
index effc8f7d..9a3aadbd 100644
--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
@@ -127,13 +127,13 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
{{proxy_funcs.func_sig(proxy_name, method)}}
{
if (isolate_)
- {{"return " if method|method_return_value != "void"}}{{method.mojom_name}}IPC(
+ return {{method.mojom_name}}IPC(
{%- for param in method|method_param_names -%}
{{param}}{{- ", " if not loop.last}}
{%- endfor -%}
);
else
- {{"return " if method|method_return_value != "void"}}{{method.mojom_name}}Thread(
+ return {{method.mojom_name}}Thread(
{%- for param in method|method_param_names -%}
{{param}}{{- ", " if not loop.last}}
{%- endfor -%}
@@ -159,16 +159,14 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
state_ = ProxyRunning;
thread_.start();
- {{ "return " if method|method_return_value != "void" -}}
- proxy_.invokeMethod(&ThreadProxy::start, ConnectionTypeBlocking
+ return proxy_.invokeMethod(&ThreadProxy::start, ConnectionTypeBlocking
{{- ", " if method|method_param_names}}
{%- for param in method|method_param_names -%}
{{param}}{{- ", " if not loop.last}}
{%- endfor -%}
);
{%- elif not method|is_async %}
- {{ "return " if method|method_return_value != "void" -}}
- ipa_->{{method.mojom_name}}(
+ return ipa_->{{method.mojom_name}}(
{%- for param in method|method_param_names -%}
{{param}}{{- ", " if not loop.last}}
{%- endfor -%}