From e86f66f68f4b7d86f85c601bba2902033b384496 Mon Sep 17 00:00:00 2001 From: rmheuer <63077980+rmheuer@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:34:14 -0500 Subject: [PATCH] Fix indentation of first line of code blocks --- cppguide.html | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cppguide.html b/cppguide.html index a23fcf4f..dac2bbc5 100644 --- a/cppguide.html +++ b/cppguide.html @@ -1037,7 +1037,7 @@
- // Iterates over the contents of a GargantuanTable. Sample usage:
+// Iterates over the contents of a GargantuanTable. Sample usage:
// GargantuanTableIterator* iter = table->NewIterator();
// for (iter->Seek("foo"); !iter->done(); iter->Next()) {
// process(iter->key(), iter->value());
@@ -1195,7 +1195,7 @@
describing what they are and what they are used for. For example:
- // The total number of tests cases that we run through in this regression test.
+// The total number of tests cases that we run through in this regression test.
const int kNumTestCases = 6;
- DoSomething(); // Comment here so the comments line up.
+DoSomething(); // Comment here so the comments line up.
DoSomethingElseThatIsLonger(); // Two spaces between the code and the comment.
{ // One space before comment when opening a new scope is allowed,
// thus the comment lines up with the following comments and code.
@@ -1354,7 +1354,7 @@
- // TODO(kl@gmail.com): Use a "*" here for concatenation operator.
+// TODO(kl@gmail.com): Use a "*" here for concatenation operator.
// TODO(Zeke) change this to use relations.
@@ -1545,7 +1545,7 @@
Functions look like this:
- ReturnType ClassName::FunctionName(Type par_name1, Type par_name2) {
+ReturnType ClassName::FunctionName(Type par_name1, Type par_name2) {
DoSomething();
...
}
@@ -1554,7 +1554,7 @@
If you have too much text to fit on one line:
- ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
+ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
Type par_name3) {
DoSomething();
...
@@ -1726,7 +1726,7 @@
comment:
- bool retval = DoSomething(scores[x] * y + bases[x], // Score heuristic.
+bool retval = DoSomething(scores[x] * y + bases[x], // Score heuristic.
x, y, z);
@@ -1836,7 +1836,7 @@
using one.
- if(condition) { // Bad - space missing after IF.
+if(condition) { // Bad - space missing after IF.
if (condition){ // Bad - space missing before {.
if(condition){ // Doubly bad.
@@ -1854,7 +1854,7 @@
This is not allowed when the if statement has an else:
- // Not allowed - IF statement on one line when there is an ELSE clause
+// Not allowed - IF statement on one line when there is an ELSE clause
if (x) DoThis();
else DoThat();
@@ -1970,7 +1970,7 @@
while (condition) continue; // Good - continue indicates no logic.
- while (condition); // Bad - looks like part of do/while loop.
+while (condition); // Bad - looks like part of do/while loop.
@@ -2071,13 +2071,13 @@
use them in x = expr;.
- return result; // No parentheses in the simple case.
+return result; // No parentheses in the simple case.
// Parentheses OK to make a complex expression more readable.
return (some_long_condition &&
another_condition);
- return (value); // You wouldn't write var = (value);
+return (value); // You wouldn't write var = (value);
return(result); // return is not a function!
@@ -2236,7 +2236,7 @@
or
- // When it requires multiple lines, indent 4 spaces, putting the colon on
+// When it requires multiple lines, indent 4 spaces, putting the colon on
// the first initializer line:
MyClass::MyClass(int var)
: some_var_(var), // 4 space indent
@@ -2302,7 +2302,7 @@
General
- void f(bool b) { // Open braces should always have a space before them.
+void f(bool b) { // Open braces should always have a space before them.
...
int i = 0; // Semicolons usually have no space before them.
// Spaces inside braces for braced-init-list are optional. If you use them,
@@ -2330,7 +2330,7 @@
Loops and Conditionals
- if (b) { // Space after the keyword in conditions and loops.
+if (b) { // Space after the keyword in conditions and loops.
} else { // Spaces around else.
}
while (test) {} // There is usually no space inside parentheses.