Skip to content

Commit d4db085

Browse files
authored
Merge pull request #5412 from Rageking8/remove-redundant-semicolons-after-if-for-while-and-switch-constructs
Remove redundant semicolons after `if`, `for`, `while`, and `switch` constructs
2 parents 62da4f5 + 1b5dc56 commit d4db085

File tree

12 files changed

+23
-28
lines changed

12 files changed

+23
-28
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
title: "switch statement (C++)"
33
description: "Reference to the Standard C++ switch statement in Microsoft Visual Studio C++."
4-
ms.date: "04/25/2020"
4+
ms.date: 04/25/2020
55
f1_keywords: ["default_cpp", "switch_cpp", "case_cpp"]
66
helpviewer_keywords: ["switch keyword [C++]", "case keyword [C++], in switch statements", "default keyword [C++]"]
77
no-loc: [switch, case, default, break, while, opt]
8-
ms.assetid: 6c3f3ed3-5593-463c-8f4b-b33742b455c6
98
---
109
# `switch` statement (C++)
1110

@@ -117,7 +116,7 @@ int main()
117116
break;
118117
case status::bad:
119118
throw BadGadget();
120-
};
119+
}
121120
```
122121
123122
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: "The Microsoft C++ reference to the __try and __except structured e
44
ms.date: 08/25/2020
55
f1_keywords: ["_abnormal_termination_cpp", "_exception_code_cpp", "_exception_info", "__except", "_except", "_exception_code", "__except_cpp", "_exception_info_cpp"]
66
helpviewer_keywords: ["__try keyword [C++]", "EXCEPTION_CONTINUE_EXECUTION macro", "EXCEPTION_CONTINUE_SEARCH macro", "EXCEPTION_EXECUTE_HANDLER macro", "GetExceptionCode function", "try-catch keyword [C++], try-except keyword [C++]", "_exception_code keyword [C++]", "try-except keyword [C++]", "_exception_info keyword [C++]", "_abnormal_termination keyword [C++]"]
7-
ms.assetid: 30d60071-ea49-4bfb-a8e6-7a420de66381
87
---
98
# `try-except` statement
109

@@ -115,7 +114,7 @@ int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep)
115114
{
116115
puts("didn't catch AV, unexpected.");
117116
return EXCEPTION_CONTINUE_SEARCH;
118-
};
117+
}
119118
}
120119

121120
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4) C4220"
32
title: "Compiler Warning (level 4) C4220"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 4) C4220"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4220"]
66
helpviewer_keywords: ["C4220"]
7-
ms.assetid: aba18868-825f-4763-9af6-3296406a80e4
87
---
98
# Compiler Warning (level 4) C4220
109

@@ -23,7 +22,7 @@ int ( *pFunc2) ( int a, int b);
2322

2423
int main()
2524
{
26-
if ( pFunc1 != pFunc2 ) {}; // C4220
25+
if ( pFunc1 != pFunc2 ) {} // C4220
2726
}
2827
```
2928

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "iterator_traits Struct"
33
description: "Learn more about: iterator_traits Struct"
4-
ms.date: "11/04/2016"
4+
ms.date: 11/04/2016
55
f1_keywords: ["xutility/std::iterator_traits"]
66
helpviewer_keywords: ["iterator_traits struct", "iterator_traits class"]
77
---
@@ -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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: "Learn more about: Other One-Argument Output Stream Manipulators"
32
title: "Other One-Argument Output Stream Manipulators"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Other One-Argument Output Stream Manipulators"
4+
ms.date: 11/04/2016
55
helpviewer_keywords: ["output streams, one-argument manipulators"]
6-
ms.assetid: e381dee8-6b16-4cef-805a-4a6a1d2b696b
76
---
87
# Other One-Argument Output Stream Manipulators
98

@@ -51,7 +50,7 @@ void fb( ios_base& os, char * somename )
5150
{
5251
for( int i=0; i < l; i++ )
5352
(*pos) << ' ';
54-
};
53+
}
5554
*/
5655
}
5756

docs/standard-library/output-stream-manipulators-with-one-argument-int-or-long.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
description: "Learn more about: Output Stream Manipulators with One Argument (int or long)"
32
title: "Output Stream Manipulators with One Argument (int or long)"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Output Stream Manipulators with One Argument (int or long)"
4+
ms.date: 11/04/2016
55
helpviewer_keywords: ["output streams, int or long argument manipulators"]
6-
ms.assetid: 338f3164-b5e2-4c5a-a605-7d9dc3629ca1
76
---
87
# Output Stream Manipulators with One Argument (int or long)
98

@@ -25,7 +24,7 @@ void fb( ios_base& os, int l )
2524
{
2625
for( int i=0; i < l; i++ )
2726
(*pos) << ' ';
28-
};
27+
}
2928
}
3029

3130
_Smanip<int>

docs/standard-library/raw-storage-iterator-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int main( void )
261261
std::raw_storage_iterator<int*,int> it( pInt );
262262
for ( int i = 0; i < 5; i++, it++ ) {
263263
*it = 2 * i;
264-
};
264+
}
265265

266266
for ( int i = 0; i < 5; i++ ) cout << "array " << i << " = " << pInt[i] << endl;
267267

0 commit comments

Comments
 (0)