Skip to contentSkip to conversation

docs/devel: Fix coding style in style.rst

PATCH In review Thomas Huth 5 participants 5 messages Jul 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/devel: Fix coding style in style.rst

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 821f296756 ("docs: document use of automatic cleanup functions in glib")
---
 docs/devel/style.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
docs/devel/style.rst +6 -3
index aa5e083ff8..3cfcdeb9cd 100644
@@ -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 = .....
 
Signature · 1 line
2.39.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 51 lines · Thomas Huth

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 821f296756 ("docs: document use of automatic cleanup functions in

glib")

---
 docs/devel/style.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
docs/devel/style.rst +2 -1
index aa5e083ff8..3cfcdeb9cd 100644
@@ -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

docs/devel/style.rst +4 -3
-    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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 36 lines · Thomas Huth

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 821f296756 ("docs: document use of automatic cleanup functions in glib")
---
 docs/devel/style.rst | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
docs/devel/style.rst +4 -2
index aa5e083ff8..3cfcdeb9cd 100644
@@ -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 = .....
 

docs/devel/style.rst are still some caveats to beware of · line 621

Quoted 8 lines
docs/devel/style.rst +2 -1
@@ -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 on v1 1/1
#3 lore raw
In reply to Thomas Huth
Quoted 10 lines · Thomas Huth

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 821f296756 ("docs: document use of automatic cleanup functions in glib")
---
  docs/devel/style.rst | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Thomas Huth
Quoted 7 lines · Thomas Huth

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 821f296756 ("docs: document use of automatic cleanup functions in glib")
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro