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)
> +{
>