Skip to contentSkip to conversation

ssh_util: fix prototype style

PATCH In review Antonio Quartulli 3 participants 3 messages Aug 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ssh_util: fix prototype style

Function prototypes should have the return type on the same line as the function name itself. Fix this in ssl_util.h.

---
 src/openvpn/ssl_util.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
src/openvpn/ssl_util.h +5 -8
index f38294c1..3695ca3c 100644
@@ -41,10 +41,8 @@
  * @return  The content of the variable as NULL terminated string or NULL if the
  *          variable cannot be found.
  */
-char *
-extract_var_peer_info(const char *peer_info,
-                      const char *var,
-                      struct gc_arena *gc);
+char *extract_var_peer_info(const char *peer_info, const char *var,
+                            struct gc_arena *gc);
 
 /**
  * Extracts the IV_PROTO variable and returns its value or 0
@@ -52,8 +50,7 @@ extract_var_peer_info(const char *peer_info,
  *
  * @param peer_info     peer info string to search for IV_PROTO
  */
-unsigned int
-extract_iv_proto(const char *peer_info);
+unsigned int extract_iv_proto(const char *peer_info);
 
 /**
  * Takes a locally produced OCC string for TLS server mode and modifies as
@@ -67,6 +64,6 @@ extract_iv_proto(const char *peer_info);
  * @param gc        gc_arena to allocate the returned string in
  * @return          the modified string or options on error
  */
-const char *
-options_string_compat_lzo(const char *options, struct gc_arena *gc);
+const char *options_string_compat_lzo(const char *options, struct gc_arena *gc);
+
 #endif
Signature · 1 line
2.30.2
#1 lore raw

Hi,

Typo, subject should probably be s/ssh_util/ssl_util

Regards,
Simon

Quoted 57 lines

Function prototypes should have the return type on the same line as the function name itself. Fix this in ssl_util.h.

---
 src/openvpn/ssl_util.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
src/openvpn/ssl_util.h +0 -0
index f38294c1..3695ca3c 100644
@@ -41,10 +41,8 @@
  * @return  The content of the variable as NULL terminated string or NULL

if the
* variable cannot be found.
*/

src/openvpn/ssl_util.h +3 -6
-char *
-extract_var_peer_info(const char *peer_info,
-                      const char *var,
-                      struct gc_arena *gc);
+char *extract_var_peer_info(const char *peer_info, const char *var,
+                            struct gc_arena *gc);
 
 /**
  * Extracts the IV_PROTO variable and returns its value or 0
@@ -52,8 +50,7 @@ extract_var_peer_info(const char *peer_info,
  *
  * @param peer_info     peer info string to search for IV_PROTO
  */
-unsigned int
-extract_iv_proto(const char *peer_info);
+unsigned int extract_iv_proto(const char *peer_info);
 
 /**
  * Takes a locally produced OCC string for TLS server mode and modifies

as

src/openvpn/ssl_util.h +2 -2
@@ -67,6 +64,6 @@ extract_iv_proto(const char *peer_info);
  * @param gc        gc_arena to allocate the returned string in
  * @return          the modified string or options on error
  */
-const char *
-options_string_compat_lzo(const char *options, struct gc_arena *gc);
+const char *options_string_compat_lzo(const char *options, struct
 gc_arena *gc);
+

#endif
--
2.30.2

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Acked-by on v1 1/1
#2 lore raw

[Openvpn-devel] [PATCH applied] Re: ssl_util: fix prototype style

In reply to Antonio Quartulli

Seems we need an uncrustify option to enforce this for new code (*most* prototypes have the "all-in-one-line" approach, some follow the "return type on previous line" as for functions).

Subject fixed, ssl_util, not ssh_util :-)

Your patch has been applied to the master branch.

commit 31346b8d8df6fb09faa56d53508205a8b74c15df

Author: Antonio Quartulli
Date:   Thu Aug 18 10:05:50 2022 +0200
     ssl_util: fix prototype style

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24983.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering