Module Name: src Committed By: jkoshy Date: Fri Dec 30 21:12:45 UTC 2022
Modified Files: src/share/misc: style Log Message: Move a style recommendation closer to the syntax that it describes. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/share/misc/style Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/misc/style diff -u src/share/misc/style:1.66 src/share/misc/style:1.67 --- src/share/misc/style:1.66 Fri Dec 30 17:02:31 2022 +++ src/share/misc/style Fri Dec 30 21:12:44 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: style,v 1.66 2022/12/30 17:02:31 jkoshy Exp $ */ +/* $NetBSD: style,v 1.67 2022/12/30 21:12:44 jkoshy Exp $ */ /* * The revision control tag appears first, with a blank line after it. @@ -30,7 +30,7 @@ #include <sys/cdefs.h> __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: style,v 1.66 2022/12/30 17:02:31 jkoshy Exp $"); +__RCSID("$NetBSD: style,v 1.67 2022/12/30 21:12:44 jkoshy Exp $"); /* * VERY important single-line comments look like this. @@ -260,11 +260,13 @@ main(int argc, char *argv[]) * Braces around single-line bodies are optional; use discretion. * * Use narrow scopes for loop variables where possible. - * - * Forever loops are done with for's, not while's. */ for (char *p = buf; *p != '\0'; ++p) continue; /* Explicit no-op */ + + /* + * Forever loops are done with for's, not while's. + */ for (;;) stmt;