libxl: CODING_STYLE: Forbid if (...) { stmt; } else stmt;
PATCH 1/1 libxl: CODING_STYLE: Forbid if (...) { stmt; } else stmt;
And clarify that the rule about omitting braces for single statements is optional (it is even contradicted by the example).
Signed-off-by Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
--- tools/libxl/CODING_STYLE | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/libxl/CODING_STYLE +4 -2
@@ -294,8 +294,10 @@ Libxenlight coding style is super simple. Avoid tricky expressions. 5. Block structure -Every indented statement is braced, except blocks that contain just -one statement. +Every indented statement is braced, but blocks that contain just one +statement may have the braces omitted. To avoid confusion, either all +the blocks in an if...else chain have braces, or none of them do. + The opening brace is on the line that contains the control flow statement that introduces the new block; the closing brace is on the same line as the else keyword, or on a line by itself if there is no
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines · Ian Jackson
And clarify that the rule about omitting braces for single statements is optional (it is even contradicted by the example).
Signed-off-by Ian Jackson <[email protected]>CC Wei Liu <[email protected]>
Acked-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Wei Liu
Quoted 5 lines · Ian Jackson
And clarify that the rule about omitting braces for single statements is optional (it is even contradicted by the example).
Signed-off-by Ian Jackson <[email protected]>CC Wei Liu <[email protected]>Acked-by Wei Liu <[email protected]>
Pushed.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel