In message <[email protected]> on Fri, 26 Jan 
2018 13:26:58 +0000, "Salz, Rich" <[email protected]> said:

rsalz> Some things I think we should add to the style guide.  Let’s discuss 
here.
rsalz> 
rsalz> No space after sizeof, use parens.  (But see 
ssl/record/rec_layer_{d1,s3}.c )

Yes

rsalz> Multiline conditionals, such as in an if, should be broken
rsalz> before the logical connector and indented an extra tabstop.
rsalz> For example:
rsalz> 
rsalz>     while (this_is_true
rsalz>               && that_is_not_false) {
rsalz>         frobit();
rsalz>         more_stuff();
rsalz>     }

Please don't call it a tabstop.  extra indentation if you will, and in
that case, it should be 4 spaces inside the parenthesis.

Now, to have indent do that for us is a whole other story...
(side note: I saw an indent program a few days ago that's quite
promising.  I'll dig it up again)

Frankly, I'm not sure I like this, and strictly speaking, it only has
visual value for 'if' conditionals, since the inside of the
conditional parenthesis is exactly 4 spaces in, and because we break
before operators, I don't see the visual problem, but that's a very
personal viewpoint, YMMV...

rsalz> When dealing with long lines, try to avoid breaking across a function 
call. Don’t do this:
rsalz>     If (some_long_text && foo(a,
rsalz>          b, c) && bar()) {
rsalz> Instead do this:
rsalz>     If (some_long_text
rsalz>         && foo(a, b, c,)
rsalz>         && bar())

YES!

rsalz> What else needs to be updated?

-- 
Richard Levitte         [email protected]
OpenSSL Project         http://www.openssl.org/~levitte/
_______________________________________________
openssl-project mailing list
[email protected]
https://mta.openssl.org/mailman/listinfo/openssl-project

Reply via email to