Skip to content

Commit 03de61e

Browse files
authored
Fix indentation of first line of code blocks (#314)
1 parent 6501b9c commit 03de61e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

cppguide.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ <h3 id="Class_Comments">
10371037
</div>
10381038
<div class="stylebody">
10391039
<pre>
1040-
// Iterates over the contents of a GargantuanTable. Sample usage:
1040+
// Iterates over the contents of a GargantuanTable. Sample usage:
10411041
// GargantuanTableIterator* iter = table-&gt;NewIterator();
10421042
// for (iter-&gt;Seek("foo"); !iter-&gt;done(); iter-&gt;Next()) {
10431043
// process(iter-&gt;key(), iter-&gt;value());
@@ -1195,7 +1195,7 @@ <h4 class="stylepoint_subsection">
11951195
describing what they are and what they are used for. For example:
11961196
</p>
11971197
<pre>
1198-
// The total number of tests cases that we run through in this regression test.
1198+
// The total number of tests cases that we run through in this regression test.
11991199
const int kNumTestCases = 6;
12001200
</pre>
12011201
</div>
@@ -1247,7 +1247,7 @@ <h4 class="stylepoint_subsection">
12471247
more readable to line them up:
12481248
</p>
12491249
<pre>
1250-
DoSomething(); // Comment here so the comments line up.
1250+
DoSomething(); // Comment here so the comments line up.
12511251
DoSomethingElseThatIsLonger(); // Two spaces between the code and the comment.
12521252
{ // One space before comment when opening a new scope is allowed,
12531253
// thus the comment lines up with the following comments and code.
@@ -1354,7 +1354,7 @@ <h3 id="TODO_Comments">
13541354
</p>
13551355
<div>
13561356
<pre>
1357-
// TODO(kl@gmail.com): Use a "*" here for concatenation operator.
1357+
// TODO(kl@gmail.com): Use a "*" here for concatenation operator.
13581358
// TODO(Zeke) change this to use relations.
13591359
</pre>
13601360
</div>
@@ -1545,7 +1545,7 @@ <h3 id="Function_Declarations_and_Definitions">
15451545
Functions look like this:
15461546
</p>
15471547
<pre>
1548-
ReturnType ClassName::FunctionName(Type par_name1, Type par_name2) {
1548+
ReturnType ClassName::FunctionName(Type par_name1, Type par_name2) {
15491549
DoSomething();
15501550
...
15511551
}
@@ -1554,7 +1554,7 @@ <h3 id="Function_Declarations_and_Definitions">
15541554
If you have too much text to fit on one line:
15551555
</p>
15561556
<pre>
1557-
ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
1557+
ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
15581558
Type par_name3) {
15591559
DoSomething();
15601560
...
@@ -1726,7 +1726,7 @@ <h3 id="Function_Calls">
17261726
comment:
17271727
</p>
17281728
<pre>
1729-
bool retval = DoSomething(scores[x] * y + bases[x], // Score heuristic.
1729+
bool retval = DoSomething(scores[x] * y + bases[x], // Score heuristic.
17301730
x, y, z);
17311731
</pre>
17321732
<p>
@@ -1836,7 +1836,7 @@ <h3 id="Conditionals">
18361836
using one.
18371837
</p>
18381838
<pre class="badcode">
1839-
if(condition) { // Bad - space missing after IF.
1839+
if(condition) { // Bad - space missing after IF.
18401840
if (condition){ // Bad - space missing before {.
18411841
if(condition){ // Doubly bad.
18421842
</pre>
@@ -1854,7 +1854,7 @@ <h3 id="Conditionals">
18541854
This is not allowed when the if statement has an <code>else</code>:
18551855
</p>
18561856
<pre class="badcode">
1857-
// Not allowed - IF statement on one line when there is an ELSE clause
1857+
// Not allowed - IF statement on one line when there is an ELSE clause
18581858
if (x) DoThis();
18591859
else DoThat();
18601860
</pre>
@@ -1970,7 +1970,7 @@ <h3 id="Loops_and_Switch_Statements">
19701970
while (condition) continue; // Good - continue indicates no logic.
19711971
</pre>
19721972
<pre class="badcode">
1973-
while (condition); // Bad - looks like part of do/while loop.
1973+
while (condition); // Bad - looks like part of do/while loop.
19741974
</pre>
19751975
</div>
19761976
<h3 id="Pointer_and_Reference_Expressions">
@@ -2071,13 +2071,13 @@ <h3 id="Return_Values">
20712071
use them in <code>x = expr;</code>.
20722072
</p>
20732073
<pre>
2074-
return result; // No parentheses in the simple case.
2074+
return result; // No parentheses in the simple case.
20752075
// Parentheses OK to make a complex expression more readable.
20762076
return (some_long_condition &amp;&
20772077
another_condition);
20782078
</pre>
20792079
<pre class="badcode">
2080-
return (value); // You wouldn't write var = (value);
2080+
return (value); // You wouldn't write var = (value);
20812081
return(result); // return is not a function!
20822082
</pre>
20832083
</div>
@@ -2236,7 +2236,7 @@ <h3 id="Constructor_Initializer_Lists">
22362236
or
22372237
</p>
22382238
<pre>
2239-
// When it requires multiple lines, indent 4 spaces, putting the colon on
2239+
// When it requires multiple lines, indent 4 spaces, putting the colon on
22402240
// the first initializer line:
22412241
MyClass::MyClass(int var)
22422242
: some_var_(var), // 4 space indent
@@ -2302,7 +2302,7 @@ <h4 class="stylepoint_subsection">
23022302
General
23032303
</h4>
23042304
<pre>
2305-
void f(bool b) { // Open braces should always have a space before them.
2305+
void f(bool b) { // Open braces should always have a space before them.
23062306
...
23072307
int i = 0; // Semicolons usually have no space before them.
23082308
// Spaces inside braces for braced-init-list are optional. If you use them,
@@ -2330,7 +2330,7 @@ <h4 class="stylepoint_subsection">
23302330
Loops and Conditionals
23312331
</h4>
23322332
<pre>
2333-
if (b) { // Space after the keyword in conditions and loops.
2333+
if (b) { // Space after the keyword in conditions and loops.
23342334
} else { // Spaces around else.
23352335
}
23362336
while (test) {} // There is usually no space inside parentheses.

0 commit comments

Comments
 (0)