[gi-docgen/issue-117: 2/2] template: Check for nullable in-out arguments




commit b125b0f0d59c8c4d4c12c3b505d8e9115298268f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Nov 15 15:37:33 2021 +0000

    template: Check for nullable in-out arguments
    
    Arguments marked as in-out can also be nullable, which means they can be
    set to NULL.

 gidocgen/templates/basic/class_method.html | 2 +-
 gidocgen/templates/basic/ctor.html         | 2 +-
 gidocgen/templates/basic/function.html     | 2 +-
 gidocgen/templates/basic/method.html       | 2 +-
 gidocgen/templates/basic/signal.html       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gidocgen/templates/basic/class_method.html b/gidocgen/templates/basic/class_method.html
index 7119bca..a628eca 100644
--- a/gidocgen/templates/basic/class_method.html
+++ b/gidocgen/templates/basic/class_method.html
@@ -119,7 +119,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
           {% if arg.direction == "in" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be 
<code>NULL</code>.</td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be set to 
<code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction in ["inout", "out"] and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can 
be set to <code>NULL</code>.</td></tr>{% endif %}
           {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
           {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
           {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
diff --git a/gidocgen/templates/basic/ctor.html b/gidocgen/templates/basic/ctor.html
index 3316dd5..038ee40 100644
--- a/gidocgen/templates/basic/ctor.html
+++ b/gidocgen/templates/basic/ctor.html
@@ -121,7 +121,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
           {% if arg.direction == "in" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be 
<code>NULL</code>.</td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be set to 
<code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction in ["inout", "out"] and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can 
be set to <code>NULL</code>.</td></tr>{% endif %}
           {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
           {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
           {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
diff --git a/gidocgen/templates/basic/function.html b/gidocgen/templates/basic/function.html
index c1ff01d..0d41008 100644
--- a/gidocgen/templates/basic/function.html
+++ b/gidocgen/templates/basic/function.html
@@ -126,7 +126,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
           {% if arg.direction == "in" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be 
<code>NULL</code>.</td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be set to 
<code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction in ["inout", "out"] and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can 
be set to <code>NULL</code>.</td></tr>{% endif %}
           {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
           {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
           {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
diff --git a/gidocgen/templates/basic/method.html b/gidocgen/templates/basic/method.html
index 778f180..b993f5e 100644
--- a/gidocgen/templates/basic/method.html
+++ b/gidocgen/templates/basic/method.html
@@ -121,7 +121,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
           {% if arg.direction == "in" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be 
<code>NULL</code>.</td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be set to 
<code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction in ["inout", "out"] and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can 
be set to <code>NULL</code>.</td></tr>{% endif %}
           {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
           {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
           {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}
diff --git a/gidocgen/templates/basic/signal.html b/gidocgen/templates/basic/signal.html
index d1d7498..8a74dc0 100644
--- a/gidocgen/templates/basic/signal.html
+++ b/gidocgen/templates/basic/signal.html
@@ -131,7 +131,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
           </tr>
           {% if arg.direction != "in" %}<tr><td>&nbsp;</td><td title="direction: {{ arg.direction}}">{{ 
arg.direction_note }}</td></tr>{% endif %}
           {% if arg.direction == "in" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be 
<code>NULL</code>.</td></tr>{% endif %}
-          {% if arg.direction == "out" and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can be set to 
<code>NULL</code>.</td></tr>{% endif %}
+          {% if arg.direction in ["inout", "out"] and arg.nullable %}<tr><td>&nbsp;</td><td>The argument can 
be set to <code>NULL</code>.</td></tr>{% endif %}
           {% if arg.optional %}<tr><td>&nbsp;</td><td>The argument can be <code>NULL</code>.</td></tr>{% 
endif %}
           {% if arg.is_array and arg.zero_terminated %}<tr><td>&nbsp;</td><td>The array must be 
<code>NULL</code>-terminated.</td></tr>{% endif %}
           {% if arg.is_array and arg.fixed_size > 0 %}<tr><td>&nbsp;</td><td>The array must have {{ 
arg.fixed_size }} elements.</td></tr>{% endif %}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]