STYLE: adds do while rule

This commit is contained in:
Emma Tebibyte 2024-07-14 02:15:07 -06:00
parent 579bf3b622
commit b22ded9e98
Signed by: emma
GPG Key ID: 06FA419A1698C270

7
STYLE
View File

@ -47,7 +47,12 @@ use sysexits::{ EX_DATAERR, EX_IOERR, EX_UNAVAILABLE, EX_USAGE };
- If a control flow statement is short enough to be easily understood in a - If a control flow statement is short enough to be easily understood in a
glance, it may be placed on a single line: glance, it may be placed on a single line:
if (!argc < 0) { usage(program_name); }if (!(argc < 0)) { usage(program_name); } if (!argc < 0) { usage(program_name); }
- If a do while loop in C is longer than ~25 lines, place the while statement
in a comment after the opening brace:
do { /* while(count == 0 || --count > 0); */
-- --
Copyright © 2024 Emma Tebibyte <emma@tebibyte.media> Copyright © 2024 Emma Tebibyte <emma@tebibyte.media>