Skip to content

Commit

Permalink
docs/devel: Fix coding style in style.rst
Browse files Browse the repository at this point in the history
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.

Fixes: 821f296 ("docs: document use of automatic cleanup functions in glib")
Reported-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Message-Id: <20230710092638.161625-1-thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed Jul 10, 2023
1 parent e02f56e commit 7233bd1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/devel/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .....
Expand All @@ -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 = .....
Expand All @@ -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 = .....
Expand Down

0 comments on commit 7233bd1

Please sign in to comment.