Skip to content

Commit 29820cb

Browse files
authored
Merge pull request #5391 from Rageking8/remove-empty-lines-at-start-and-end-of-code-block
Remove empty lines at start and end of code block
2 parents 9f31d89 + d954c46 commit 29820cb

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

docs/code-quality/c6393.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: "Learn more about: Warning C6393"
32
title: Warning C6393
3+
description: "Learn more about: Warning C6393"
44
ms.date: 11/29/2023
55
f1_keywords: ["C6393", "LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP", "__WARNING_LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP"]
66
helpviewer_keywords: ["C6393"]
@@ -26,26 +26,25 @@ Code analysis name: `LEAP_YEAR_INVALID_DATE_KEYED_LOOKUP`
2626
The following code creates a lookup table for the day of the year, assuming 365 days per year. However, this doesn't work if the year is a leap year:
2727

2828
```cpp
29-
30-
#include <vector>
31-
32-
void foo(int year)
33-
{
34-
const std::vector<int> items(365); // C6393
35-
// Initialize items and use it...
29+
#include <vector>
30+
31+
void foo(int year)
32+
{
33+
const std::vector<int> items(365); // C6393
34+
// Initialize items and use it...
3635
}
3736
```
3837
3938
To fix the problem, adjust the size of the lookup table as the table is created according to the result of appropriate leap year check:
4039
4140
```cpp
42-
#include <vector>
43-
44-
void foo(int year)
45-
{
46-
bool isLeapYear = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
47-
const std::vector<int> items(isLeapYear ? 366 : 365);
48-
// Initialize items and use it...
41+
#include <vector>
42+
43+
void foo(int year)
44+
{
45+
bool isLeapYear = year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
46+
const std::vector<int> items(isLeapYear ? 366 : 365);
47+
// Initialize items and use it...
4948
}
5049
```
5150

docs/cpp/functions-cpp.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
description: "Learn more about: Functions (C++)"
32
title: "Functions (C++)"
4-
ms.date: "11/19/2018"
3+
description: "Learn more about: Functions (C++)"
4+
ms.date: 11/19/2018
55
helpviewer_keywords: ["defaults, arguments", "function definitions", "function definitions, about function definitions", "default arguments", "declarators, functions"]
66
---
77
# Functions (C++)
@@ -77,7 +77,6 @@ Optional parts of a function declaration are:
7777
```cpp
7878
//Declare printf with C linkage.
7979
extern "C" int printf( const char *fmt, ... );
80-
8180
```
8281

8382
For more information, see [Translation units and linkage](../cpp/program-and-linkage-cpp.md).

docs/porting/visual-cpp-what-s-new-2003-through-2015.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ Although these differences can affect your source code or other build artifacts,
226226
```cpp
227227
error C3688: invalid literal suffix '_x'; literal operator or literal operator template 'operator ""_x' not found
228228
note: Did you forget a space between the string literal and the prefix of the following string literal?
229-
230229
```
231230

232231
To fix this problem, add a space between the string literal and the macro.

0 commit comments

Comments
 (0)