diff --git a/Coding-Style.md b/Coding-Style.md index d55f35e..6df0575 100644 --- a/Coding-Style.md +++ b/Coding-Style.md @@ -51,16 +51,30 @@ while ((c = *str++)) hash = (hash * 33) ^ c; } ``` +Continuation lines should align wrapped elements with the first argument (excluding reference operators) or use a hanging indent. When using a hanging indent, there should be no arguments on the first line and all subsequent "hanging" lines should be indented with 2 spaces in relation to the calling command: +#### Aligned Along First Deliminator ```c +# Correct error = initialize_tagtree(&prec_control->tag_inclusion, prec_control->numCbX, prec_control->numCbY, prec_control->numCbZ, prec_control->numCbTS) exit(error); + +# Wrong +error = initialize_tagtree(&prec_control->tag_inclusion, + prec_control->numCbX, + prec_control->numCbY, + prec_control->numCbZ, + prec_control->numCbTS) +exit(error); ``` + +#### Hanging Indent ```c +# Correct error = initialize_tagtree( &prec_control->tag_inclusion, prec_control->numCbX, @@ -68,6 +82,15 @@ error = initialize_tagtree( prec_control->numCbZ, prec_control->numCbTS); exit(error); + +# Wrong +error = initialize_tagtree( + &prec_control->tag_inclusion, + prec_control->numCbX, + prec_control->numCbY, + prec_control->numCbZ, + prec_control->numCbTS); +exit(error); ``` ### Braces