Skip to content

Commit 580858e

Browse files
authored
Remove redundant semicolons after if, for, while, and switch constructs
1 parent e306168 commit 580858e

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_39.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
{
99
_tprintf_s(_T("Resulting token: %s\n"), resToken);
1010
resToken = str.Tokenize(_T("% #"), curPos);
11-
};
11+
}

docs/cpp/switch-statement-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int main()
117117
break;
118118
case status::bad:
119119
throw BadGadget();
120-
};
120+
}
121121
```
122122
123123
An inner block of a **`switch`** statement can contain definitions with initializers as long as they're *reachable*, that is, not bypassed by all possible execution paths. Names introduced using these declarations have local scope. For example:

docs/cpp/try-except-statement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
115115
{
116116
puts("didn't catch AV, unexpected.");
117117
return EXCEPTION_CONTINUE_SEARCH;
118-
};
118+
}
119119
}
120120

121121
int main()

docs/cppcx/codesnippet/CPP/cppcx_strings/class1.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ void Test1()
5555
if (str1 == str2) { /* ... */ }
5656
if (str1->Equals(str2)) { /* ... */ }
5757
if (str1 != str2) { /* ... */ }
58-
if (str1 < str2 || str1 > str2) { /* ... */};
58+
if (str1 < str2 || str1 > str2) { /* ... */ }
5959
int result = String::CompareOrdinal(str1, str2);
6060

61-
if(str1 == nullptr) { /* ...*/};
62-
if(str1->IsEmpty()) { /* ...*/};
61+
if (str1 == nullptr) { /* ...*/ }
62+
if (str1->IsEmpty()) { /* ...*/ }
6363

6464
// Accessing individual characters in a String^
6565
auto it = str1->Begin();

docs/error-messages/compiler-warnings/compiler-warning-level-4-c4220.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int ( *pFunc2) ( int a, int b);
2323

2424
int main()
2525
{
26-
if ( pFunc1 != pFunc2 ) {}; // C4220
26+
if ( pFunc1 != pFunc2 ) {} // C4220
2727
}
2828
```
2929

docs/mfc/codesnippet/CPP/cdialog-class_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ void CMyDialog::OnMenuShowAboutDialog()
2626
default:
2727
// Do something
2828
break;
29-
};
29+
}
3030
}

docs/standard-library/ctype-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ int main() {
466466
<< (maskarray[i] & ctype_base::alpha "alpha"
467467
: "not alpha")
468468
<< endl;
469-
};
469+
}
470470
}
471471
```
472472

docs/standard-library/ios-base-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ void callback1( ios_base::event e, ios_base& stream, int arg )
665665
case ios_base::copyfmt_event:
666666
cout << "an copyfmt event" << endl;
667667
break;
668-
};
668+
}
669669
}
670670

671671
void callback2( ios_base::event e, ios_base& stream, int arg )
@@ -682,7 +682,7 @@ void callback2( ios_base::event e, ios_base& stream, int arg )
682682
case ios_base::copyfmt_event:
683683
cout << "an copyfmt event" << endl;
684684
break;
685-
};
685+
}
686686
}
687687

688688
int main( )

docs/standard-library/iterator-traits-struct.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function( it i1, it i2 )
8888
x = *i1;
8989
cout << x << " ";
9090
i1++;
91-
};
91+
}
9292
cout << endl;
9393
};
9494

docs/standard-library/other-one-argument-output-stream-manipulators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void fb( ios_base& os, char * somename )
5151
{
5252
for( int i=0; i < l; i++ )
5353
(*pos) << ' ';
54-
};
54+
}
5555
*/
5656
}
5757

0 commit comments

Comments
 (0)