From: Tim Wiederhake Date: Thu, 13 Jan 2022 16:53:25 +0000 (+0100) Subject: docs: coding-style: One variable declaration per line X-Git-Tag: v8.1.0-rc1~376 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c68f120a55ed29576c20bea9d504e39b572b2b0;p=thirdparty%2Flibvirt.git docs: coding-style: One variable declaration per line This was not mentioned before. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Martin Kletzander --- diff --git a/docs/coding-style.rst b/docs/coding-style.rst index af928a16c0..cb23751721 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -600,6 +600,19 @@ calling another function. ... } +Prefer variable definitions on separate lines. This allows for smaller, +easier to understand diffs when changing them. Define variables in the +smallest possible scope. + +:: + + GOOD: + int count = 0; + int nnodes; + + BAD: + int count = 0, nnodes; + Attribute annotations ---------------------