Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-15 Thread Selva Nair
On Thu, Dec 15, 2016 at 8:00 AM, David Sommerseth < open...@sf.lists.topphemmelig.net> wrote: > > The only issue I noticed is that some functions, for loops and switch > > statements have their opening braces on the same line > > ssl.c line 272, tun.c line 697 and many such in the several files.

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-15 Thread David Sommerseth
On 15/12/16 06:09, Selva Nair wrote: > > On Wed, Dec 14, 2016 at 4:18 PM, David Sommerseth > > wrote: > > On 13/12/16 22:42, David Sommerseth wrote: > > > > Hi all, > > > > So the first phase of

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-14 Thread Selva Nair
On Wed, Dec 14, 2016 at 4:18 PM, David Sommerseth wrote: > On 13/12/16 22:42, David Sommerseth wrote: > > > > Hi all, > > > > So the first phase of the great reformatting is on its way. I have > > just pushed out a reformatting branch to the following > >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-14 Thread Steffan Karger
Hi, On 14-12-16 22:18, David Sommerseth wrote: > On 13/12/16 22:42, David Sommerseth wrote: >> So the first phase of the great reformatting is on its way. I have >> just pushed out a reformatting branch to the following >> repositories: > >> https://github.com:OpenVPN/openvpn.git >>

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-14 Thread David Sommerseth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/12/16 22:42, David Sommerseth wrote: > > Hi all, > > So the first phase of the great reformatting is on its way. I have > just pushed out a reformatting branch to the following > repositories: > > https://github.com:OpenVPN/openvpn.git >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Selva Nair
On Tue, Dec 13, 2016 at 5:08 PM, Steffan Karger wrote: > > This is based on the last master branch, with two additional commits. > > The first commit adds the reformatting script which does the complete > > reformatting in a consistent way across the complete source tree.

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Steffan Karger
On 13-12-16 22:42, David Sommerseth wrote: > So the first phase of the great reformatting is on its way. I have > just pushed out a reformatting branch to the following repositories: > >https://github.com:OpenVPN/openvpn.git >https://gitlab.com:openvpn/openvpn.git >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread David Sommerseth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, So the first phase of the great reformatting is on its way. I have just pushed out a reformatting branch to the following repositories: https://github.com:OpenVPN/openvpn.git https://gitlab.com:openvpn/openvpn.git

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread David Sommerseth
On 13/12/16 22:05, Selva Nair wrote: > > On Tue, Dec 13, 2016 at 3:56 PM, David Sommerseth > > wrote: > > Already at it. Written a script to do everything in a consistent way, > added the cmt_cpp_to_c=true

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Selva Nair
On Tue, Dec 13, 2016 at 3:56 PM, David Sommerseth < open...@sf.lists.topphemmelig.net> wrote: > Already at it. Written a script to do everything in a consistent way, > added the cmt_cpp_to_c=true (and sp_arith=add) > As Steffan mentioned we do had decided against sp_arith = add, but please

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Selva Nair
On Tue, Dec 13, 2016 at 3:59 PM, David Sommerseth < open...@sf.lists.topphemmelig.net> wrote: > If it breaks a boolean expression over more lines, the operator comes as > the lead character on the following line > > i = TEST1 >| TEST2 >| TEST3 > > instead of > > i = TEST1

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread David Sommerseth
On 13/12/16 21:10, Steffan Karger wrote: > Hi, > > On 13-12-16 20:54, Selva Nair wrote: >> >> On Tue, Dec 13, 2016 at 1:55 PM, Steffan Karger > > wrote: >> >> > >> > On 09/12/16 22:27, Steffan Karger wrote: >> > > >> > >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread David Sommerseth
On 13/12/16 19:55, Steffan Karger wrote: > > On 09-12-16 22:44, Selva Nair wrote: >> On Fri, Dec 9, 2016 at 4:39 PM, David Sommerseth >> > > wrote: >> >> On 09/12/16 22:27, Steffan Karger wrote: >> > >> >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Steffan Karger
Hi, On 13-12-16 21:22, Selva Nair wrote: > > pos_bool=lead > > What does this do exactly? The description "The position of boolean > operators in wrapped expressions" from --show-config doesn't ring a bell > for me. > > This extends the pos_arith=lead (Knuth style) to booleans

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Selva Nair
On Tue, Dec 13, 2016 at 3:10 PM, Steffan Karger wrote: > > sp_bool=add > > This makes sense > > sp_arith=add > > I think we agreed on IRC to not touch arithmetic spacing, because > clarity really depends on the code. > Forgot about that discussion. Seeing lines like

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Steffan Karger
Hi, On 13-12-16 20:54, Selva Nair wrote: > > On Tue, Dec 13, 2016 at 1:55 PM, Steffan Karger > wrote: > > > > > On 09/12/16 22:27, Steffan Karger wrote: > > > > > > Sounds like we have a final config on the CodeStyle

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Selva Nair
On Tue, Dec 13, 2016 at 1:55 PM, Steffan Karger wrote: > > > > On 09/12/16 22:27, Steffan Karger wrote: > > > > > > Sounds like we have a final config on the CodeStyle page now. Are > we > > > ready to run it on all code now, and publish a reformat branch? > >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-13 Thread Steffan Karger
On 09-12-16 22:44, Selva Nair wrote: > On Fri, Dec 9, 2016 at 4:39 PM, David Sommerseth > > wrote: > > On 09/12/16 22:27, Steffan Karger wrote: > > > > Sounds like we have a final config on the CodeStyle

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Selva Nair
On Fri, Dec 9, 2016 at 4:39 PM, David Sommerseth < open...@sf.lists.topphemmelig.net> wrote: > On 09/12/16 22:27, Steffan Karger wrote: > > > > Sounds like we have a final config on the CodeStyle page now. Are we > > ready to run it on all code now, and publish a reformat branch? > > > > Agreed.

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread David Sommerseth
On 09/12/16 22:27, Steffan Karger wrote: > > Sounds like we have a final config on the CodeStyle page now. Are we > ready to run it on all code now, and publish a reformat branch? > Agreed. I can do this later this night. -- kind regards, David Sommerseth OpenVPN Technologies, Inc

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Steffan Karger
On 9 December 2016 at 21:43, Selva Nair wrote: > On Fri, Dec 9, 2016 at 8:41 AM, Steffan Karger wrote: >> On 9 December 2016 at 00:14, David Sommerseth >> wrote: >> > I just spotted in ssl.c that we need sp_assign=add.

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Selva Nair
On Fri, Dec 9, 2016 at 8:41 AM, Steffan Karger wrote: > > On 9 December 2016 at 00:14, David Sommerseth > wrote: > > I just spotted in ssl.c that we need sp_assign=add. > > > > [ ssl.c, tls1_PRF() ] > > len = slen/2; > > S1 = sec; >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Steffan Karger
Hi, On 9 December 2016 at 00:14, David Sommerseth wrote: > I just spotted in ssl.c that we need sp_assign=add. > > [ ssl.c, tls1_PRF() ] > len = slen/2; > S1 = sec; > S2 = &(sec[len]); > len += (slen&1); /* add for odd, make longer */ > > I

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Gert Doering
Hi, On Fri, Dec 09, 2016 at 08:24:24AM -0500, Selva Nair wrote: > On Fri, Dec 9, 2016 at 2:42 AM, Gert Doering wrote: > > > if (a>0) > > { do_this(); } > > else > > { do_that(); } > > > > In such cases I would normally skip all braces, in spite of all the >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-09 Thread Selva Nair
On Fri, Dec 9, 2016 at 2:42 AM, Gert Doering wrote: > if (a>0) > { do_this(); } > else > { do_that(); } > In such cases I would normally skip all braces, in spite of all the arguments against it... But that's just me. That said the proposed re-formatting

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Gert Doering
Hi, On Thu, Dec 08, 2016 at 05:04:53PM -0500, Selva Nair wrote: > if () > { >... > } > followed by > else if (xxx) { > > } > > looks inconsitent and not pretty. Thanks, so I'm not alone with this :-) > Why not just stick to: > > if (carefree()) > { >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread David Sommerseth
On 08/12/16 23:45, David Sommerseth wrote: > On 08/12/16 22:56, Selva Nair wrote: >> Hi, >> >> On Thu, Dec 8, 2016 at 4:15 PM, David Sommerseth >> > > wrote: >> >> >> This is fairly inline with the initial agreement

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread David Sommerseth
On 08/12/16 22:56, Selva Nair wrote: > Hi, > > On Thu, Dec 8, 2016 at 4:15 PM, David Sommerseth > > wrote: > > > This is fairly inline with the initial agreement from the 2014 Munich > hackathon [3] and the

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Steffan Karger
Hi, On 08-12-16 23:24, Steffan Karger wrote: > On 08-12-16 22:56, Selva Nair wrote: >> Reformatted tun.c has at least two instances of char* xxx, we want char >> *xxx, right? So why not add some sp_xxx_ptr_star options. > > We settled for char *xxx yesterday, so I'll add that. > >> Less of a

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Steffan Karger
On 08-12-16 22:56, Selva Nair wrote: > Reformatted tun.c has at least two instances of char* xxx, we want char > *xxx, right? So why not add some sp_xxx_ptr_star options. We settled for char *xxx yesterday, so I'll add that. > Less of a concern at least for me is function_name (...) and >

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Selva Nair
On Thu, Dec 8, 2016 at 4:50 PM, Steffan Karger wrote: > . > > > This proposal allows for the "open bracing" question, which allows > > '} else {' and '} else if () {'. > > > > So now the bike shed debate opens up ... Is this something we can get > > consensus around? > > Even

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Selva Nair
Hi, On Thu, Dec 8, 2016 at 4:15 PM, David Sommerseth wrote: > > This is fairly inline with the initial agreement from the 2014 Munich > hackathon [3] and the summarized CodeStyle wiki page [4]. > > This proposal allows for the "open bracing" question, which

Re: [Openvpn-devel] Coding style clean-up ... phase 1

2016-12-08 Thread Steffan Karger
On 08-12-16 22:15, David Sommerseth wrote: > This is fairly inline with the initial agreement from the 2014 Munich > hackathon [3] and the summarized CodeStyle wiki page [4]. Thanks! The consistency of the reformatted examples is an amazing contrast to our current code base. > This proposal