From b22ded9e98a68e56dae6efb878f2ad685bd95af2 Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 14 Jul 2024 02:15:07 -0600 Subject: [PATCH] STYLE: adds do while rule --- STYLE | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/STYLE b/STYLE index 01940d9..5560aa3 100644 --- a/STYLE +++ b/STYLE @@ -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 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