diff mbox series

docs/devel: Fix coding style in style.rst

Message ID 20230710092638.161625-1-thuth@redhat.com
State New
Headers show
Series docs/devel: Fix coding style in style.rst | expand

Commit Message

Thomas Huth July 10, 2023, 9:26 a.m. UTC
As defined earlier in this file, the opening curly brace of
functions should be placed on a separate line. So we should
do it in the examples here, too.

Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Fixes: 821f296756 ("docs: document use of automatic cleanup functions in glib")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/devel/style.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Konstantin Kostiuk July 10, 2023, 9:32 a.m. UTC | #1
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Mon, Jul 10, 2023 at 12:26 PM Thomas Huth <thuth@redhat.com> wrote:

> As defined earlier in this file, the opening curly brace of
> functions should be placed on a separate line. So we should
> do it in the examples here, too.
>
> Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Fixes: 821f296756 ("docs: document use of automatic cleanup functions in
> glib")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  docs/devel/style.rst | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/docs/devel/style.rst b/docs/devel/style.rst
> index aa5e083ff8..3cfcdeb9cd 100644
> --- a/docs/devel/style.rst
> +++ b/docs/devel/style.rst
> @@ -567,7 +567,8 @@ For example, instead of
>
>  .. code-block:: c
>
> -    int somefunc(void) {
> +    int somefunc(void)
> +    {
>          int ret = -1;
>          char *foo = g_strdup_printf("foo%", "wibble");
>          GList *bar = .....
> @@ -588,7 +589,8 @@ Using g_autofree/g_autoptr enables the code to be
> written as:
>
>  .. code-block:: c
>
> -    int somefunc(void) {
> +    int somefunc(void)
> +    {
>          g_autofree char *foo = g_strdup_printf("foo%", "wibble");
>          g_autoptr (GList) bar = .....
>
> @@ -613,7 +615,8 @@ are still some caveats to beware of
>
>  .. code-block:: c
>
> -    char *somefunc(void) {
> +    char *somefunc(void)
> +    {
>          g_autofree char *foo = g_strdup_printf("foo%", "wibble");
>          g_autoptr (GList) bar = .....
>
> --
> 2.39.3
>
>
Markus Armbruster July 10, 2023, 9:49 a.m. UTC | #2
Thomas Huth <thuth@redhat.com> writes:

> As defined earlier in this file, the opening curly brace of
> functions should be placed on a separate line. So we should
> do it in the examples here, too.
>
> Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Fixes: 821f296756 ("docs: document use of automatic cleanup functions in glib")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  docs/devel/style.rst | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/docs/devel/style.rst b/docs/devel/style.rst
> index aa5e083ff8..3cfcdeb9cd 100644
> --- a/docs/devel/style.rst
> +++ b/docs/devel/style.rst
> @@ -567,7 +567,8 @@ For example, instead of
>  
>  .. code-block:: c
>  
> -    int somefunc(void) {
> +    int somefunc(void)
> +    {
>          int ret = -1;
>          char *foo = g_strdup_printf("foo%", "wibble");
>          GList *bar = .....
> @@ -588,7 +589,8 @@ Using g_autofree/g_autoptr enables the code to be written as:
>  
>  .. code-block:: c
>  
> -    int somefunc(void) {
> +    int somefunc(void)
> +    {
>          g_autofree char *foo = g_strdup_printf("foo%", "wibble");
>          g_autoptr (GList) bar = .....
>  
> @@ -613,7 +615,8 @@ are still some caveats to beware of
>  
>  .. code-block:: c
>  
> -    char *somefunc(void) {
> +    char *somefunc(void)
> +    {
>          g_autofree char *foo = g_strdup_printf("foo%", "wibble");
>          g_autoptr (GList) bar = .....

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Philippe Mathieu-Daudé July 10, 2023, 10:06 a.m. UTC | #3
On 10/7/23 11:26, Thomas Huth wrote:
> As defined earlier in this file, the opening curly brace of
> functions should be placed on a separate line. So we should
> do it in the examples here, too.
> 
> Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Fixes: 821f296756 ("docs: document use of automatic cleanup functions in glib")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   docs/devel/style.rst | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Alex Bennée July 10, 2023, 10:29 a.m. UTC | #4
Thomas Huth <thuth@redhat.com> writes:

> As defined earlier in this file, the opening curly brace of
> functions should be placed on a separate line. So we should
> do it in the examples here, too.
>
> Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
> Fixes: 821f296756 ("docs: document use of automatic cleanup functions in glib")
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
diff mbox series

Patch

diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index aa5e083ff8..3cfcdeb9cd 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -567,7 +567,8 @@  For example, instead of
 
 .. code-block:: c
 
-    int somefunc(void) {
+    int somefunc(void)
+    {
         int ret = -1;
         char *foo = g_strdup_printf("foo%", "wibble");
         GList *bar = .....
@@ -588,7 +589,8 @@  Using g_autofree/g_autoptr enables the code to be written as:
 
 .. code-block:: c
 
-    int somefunc(void) {
+    int somefunc(void)
+    {
         g_autofree char *foo = g_strdup_printf("foo%", "wibble");
         g_autoptr (GList) bar = .....
 
@@ -613,7 +615,8 @@  are still some caveats to beware of
 
 .. code-block:: c
 
-    char *somefunc(void) {
+    char *somefunc(void)
+    {
         g_autofree char *foo = g_strdup_printf("foo%", "wibble");
         g_autoptr (GList) bar = .....