[libcamera-devel,RFC,2/6] utils: ipc: Prevent struct constructors from being parsed by doxygen
diff mbox series

Message ID 20210524084029.1179881-3-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • Generate docs from mojom files
Related show

Commit Message

Paul Elder May 24, 2021, 8:40 a.m. UTC
Currently the generated constructors for structs defined in mojom files
is being parsed by mojom. As the parameters are simply the struct
members, they are already documented, and the documentation of the
constructor is pointless. Protect them against being parsed by doxygen.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 .../generators/libcamera_templates/definition_functions.tmpl   | 3 +++
 1 file changed, 3 insertions(+)

Comments

Laurent Pinchart May 24, 2021, 1:17 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Mon, May 24, 2021 at 05:40:25PM +0900, Paul Elder wrote:
> Currently the generated constructors for structs defined in mojom files
> is being parsed by mojom. As the parameters are simply the struct
> members, they are already documented, and the documentation of the
> constructor is pointless. Protect them against being parsed by doxygen.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

Looks good to me, but this change is already present in master :-)

> ---
>  .../generators/libcamera_templates/definition_functions.tmpl   | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
> index cdd75f89..94bb4918 100644
> --- a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
> @@ -25,6 +25,7 @@ enum {{enum.mojom_name}} {
>  struct {{struct.mojom_name}}
>  {
>  public:
> +#ifndef __DOXYGEN__
>  	{{struct.mojom_name}}() {%- if struct|has_default_fields %}
>  		:{% endif %}
>  {%- for field in struct.fields|with_default_values -%}
> @@ -44,6 +45,8 @@ public:
>  {%- endfor %}
>  	{
>  	}
> +#endif
> +
>  {% for field in struct.fields %}
>  	{{field|name}} {{field.mojom_name}};
>  {%- endfor %}

Patch
diff mbox series

diff --git a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
index cdd75f89..94bb4918 100644
--- a/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
+++ b/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
@@ -25,6 +25,7 @@  enum {{enum.mojom_name}} {
 struct {{struct.mojom_name}}
 {
 public:
+#ifndef __DOXYGEN__
 	{{struct.mojom_name}}() {%- if struct|has_default_fields %}
 		:{% endif %}
 {%- for field in struct.fields|with_default_values -%}
@@ -44,6 +45,8 @@  public:
 {%- endfor %}
 	{
 	}
+#endif
+
 {% for field in struct.fields %}
 	{{field|name}} {{field.mojom_name}};
 {%- endfor %}