Re: [Openvpn-devel] [PATCH v2] More broadly enforce Allman style and braces-around-conditionals

2017-01-12 Thread Steffan Karger

On 12-01-17 02:14, David Sommerseth wrote:
> So I tried to apply this one, but there are some odd issues now.  Did
> you apply your changes against the proper branch locally?  Because a
> couple of these ones are really odd.

Oops, indeed, this one seems to be based on my local branch with lots of
extra commits.  Sorry for that.  I'll send a v3.

-Steffan

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [PATCH v2] More broadly enforce Allman style and braces-around-conditionals

2017-01-11 Thread David Sommerseth
On 23/12/16 23:40, Steffan Karger wrote:
> We want { and } aligned, which means also adding a newline between each
> for() and {, while() and {, etc.
> 
> Also, we agreed to always use braces with conditionals.  The previous
> uncrustify config added these for if()s, now also add these for while()
> and for().
> 
> Signed-off-by: Steffan Karger 
> ---
> This patch replaces the "Add nl_for_brace=add to uncrustify.conf" patch.
> 
> v2: also add nl_do_brace=add and mod_full_brace_do=add
> 
>  dev-tools/uncrustify.conf  |  8 +
>  src/compat/compat-daemon.c |  3 +-
>  src/compat/compat-dirname.c|  7 +++-
>  src/compat/compat-inet_ntop.c  |  3 +-
>  src/compat/compat-inet_pton.c  |  3 +-
>  src/compat/compat-versionhelpers.h | 36 ++---
>  src/openvpn/argv.c | 10 ++
>  src/openvpn/base64.c   | 11 +--
>  src/openvpn/buffer.c   |  9 +-
>  src/openvpn/buffer.h   |  2 ++
>  src/openvpn/comp-lz4.c |  3 +-
>  src/openvpn/compstub.c |  3 +-
>  src/openvpn/console.c  |  6 ++--
>  src/openvpn/crypto.c   | 18 +++
>  src/openvpn/crypto.h   |  3 +-
>  src/openvpn/crypto_mbedtls.h   |  3 +-
>  src/openvpn/crypto_openssl.c   |  6 ++--
>  src/openvpn/cryptoapi.c|  9 --
>  src/openvpn/dhcp.c | 11 +--
>  src/openvpn/error.c|  3 +-
>  src/openvpn/error.h|  3 +-
>  src/openvpn/event.c|  4 +++
>  src/openvpn/fragment.c |  9 +-
>  src/openvpn/gremlin.c  | 15 ++---
>  src/openvpn/httpdigest.c   |  3 +-
>  src/openvpn/init.c | 11 ++-
>  src/openvpn/interval.h |  3 +-
>  src/openvpn/list.c |  6 ++--
>  src/openvpn/lzo.c  |  3 +-
>  src/openvpn/manage.c   | 15 +++--
>  src/openvpn/mbuf.c |  3 +-
>  src/openvpn/memdbg.h   |  3 +-
>  src/openvpn/misc.c |  9 +-
>  src/openvpn/mroute.c   |  3 +-
>  src/openvpn/mss.c  |  3 +-
>  src/openvpn/mtcp.c |  3 +-
>  src/openvpn/multi.c| 14 ++--
>  src/openvpn/ntlm.c | 14 +---
>  src/openvpn/occ.c  |  3 +-
>  src/openvpn/openvpn.c  |  6 ++--
>  src/openvpn/options.c  | 52 +++---
>  src/openvpn/otime.h|  3 +-
>  src/openvpn/packet_id.c|  3 +-
>  src/openvpn/perf.c |  5 ++-
>  src/openvpn/perf.h |  9 --
>  src/openvpn/pkcs11.c   | 66 
> +-
>  src/openvpn/plugin.c   | 11 ++-
>  src/openvpn/pool.c |  2 ++
>  src/openvpn/proxy.c| 10 --
>  src/openvpn/reliable.c |  7 +++-
>  src/openvpn/route.c| 13 +++-
>  src/openvpn/route.h|  3 +-
>  src/openvpn/schedule.c |  4 +++
>  src/openvpn/session_id.c   |  3 +-
>  src/openvpn/shaper.c   |  3 +-
>  src/openvpn/socket.c   | 12 +--
>  src/openvpn/socket.h   | 24 +-
>  src/openvpn/ssl.c  | 26 +++
>  src/openvpn/ssl_mbedtls.c  |  8 +++--
>  src/openvpn/ssl_openssl.c  |  3 +-
>  src/openvpn/ssl_verify.c   |  6 
>  src/openvpn/ssl_verify_mbedtls.c   |  2 ++
>  src/openvpn/ssl_verify_openssl.c   |  3 +-
>  src/openvpn/tls_crypt.c|  6 ++--
>  src/openvpn/tun.c  | 26 +++
>  src/openvpn/win32.c|  8 +++--
>  src/openvpnserv/automatic.c|  3 +-
>  src/openvpnserv/interactive.c  |  5 ++-
>  src/plugins/auth-pam/utils.c   |  5 ++-
>  src/plugins/down-root/down-root.c  |  2 ++
>  70 files changed, 479 insertions(+), 144 deletions(-)
> 

So I tried to apply this one, but there are some odd issues now.  Did
you apply your changes against the proper branch locally?  Because a
couple of these ones are really odd.

> --- a/src/openvpn/crypto_openssl.c
> +++ b/src/openvpn/crypto_openssl.c
> @@ -558,7 +559,8 @@ cipher_kt_iv_size(const EVP_CIPHER *cipher_kt)
>  }
>  
>  int
> -cipher_kt_block_size(const EVP_CIPHER *cipher) {
> +cipher_kt_block_size(const EVP_CIPHER *cipher)
> +{
>  /*
>   * OpenSSL reports OFB/CFB/GCM cipher block sizes as '1 byte'.  To work
>   * around that, try to replace the mode with 'CBC' and return the block 
> size

For some odd reason, this hunk does not apply ... not even with
'patch -p1'.


> --- a/src/openvpn/memdbg.h
> +++ b/src/openvpn/memdbg.h
> @@ -90,7 +90,8 @@
>  #include "dmalloc.h"
>  
>  static inline void *
> -openvpn_dmalloc(const char *file, int line, size_t size) {
> +openvpn_dmalloc(const char *file, int line, size_t size)
> +{
>  

Re: [Openvpn-devel] [PATCH v2] More broadly enforce Allman style and braces-around-conditionals

2016-12-24 Thread Gert Doering
Hi,

On Fri, Dec 23, 2016 at 11:40:54PM +0100, Steffan Karger wrote:
> This patch replaces the "Add nl_for_brace=add to uncrustify.conf" patch.
> 
> v2: also add nl_do_brace=add and mod_full_brace_do=add
> 
>  dev-tools/uncrustify.conf  |  8 +
[..]
> diff --git a/dev-tools/uncrustify.conf b/dev-tools/uncrustify.conf
> index 95e0b2a..d8ea870 100644
> --- a/dev-tools/uncrustify.conf
> +++ b/dev-tools/uncrustify.conf
> @@ -9,6 +9,11 @@ nl_brace_else=add
>  nl_elseif_brace=add
>  nl_else_brace=add
>  nl_else_if=remove
> +nl_for_brace=add
> +nl_while_brace=add
> +nl_switch_brace=add
> +nl_fdef_brace=add
> +nl_do_brace=add
>  sp_func_proto_paren=Remove
>  sp_func_def_paren=Remove
>  sp_func_call_paren=Remove
> @@ -44,6 +49,9 @@ nl_after_func_proto=2
>  # Always use scoping braces for conditionals
>  mod_full_brace_if=add
>  mod_full_brace_if_chain=false
> +mod_full_brace_while=add
> +mod_full_brace_for=add
> +mod_full_brace_do=add
>  
>  # Annotate #else and #endif statements
>  mod_add_long_ifdef_endif_comment=20

Both the conceptual change / uncrustify.conf and the actual code changes
look reasonable and "fully according to how I interpret our CodingStyle
wiki".  So ACK.

As per the previous reformatting discussions, lets put this into master
and 2.4-after-2.4.0

gert
-- 
USENET is *not* the non-clickable part of WWW!
   //www.muc.de/~gert/
Gert Doering - Munich, Germany g...@greenie.muc.de
fax: +49-89-35655025g...@net.informatik.tu-muenchen.de


signature.asc
Description: PGP signature
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel