Skip to content

Commit 5794c2d

Browse files
authored
1769497, fixed duplicate-headings sugestions. (#3149)
1 parent dc4ec74 commit 5794c2d

File tree

100 files changed

+102
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+102
-350
lines changed

docs/atl-mfc-shared/reference/cimage-class.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ To determine if an attached bitmap is a DIB section, call [IsDibSection](#isdibs
104104
105105
`CImage` cannot be selected into a new [CDC](../../mfc/reference/cdc-class.md). `CImage` creates its own HDC for the image. Because an HBITMAP can only be selected into one HDC at a time, the HBITMAP associated with the `CImage` cannot be selected into another HDC. If you need a CDC, retrieve the HDC from the `CImage` and give it to [CDC::FromHandle](../../mfc/reference/cdc-class.md#fromhandle).
106106

107-
## Example
107+
## Examples
108108

109109
```cpp
110110
// Get a CDC for the image
@@ -117,8 +117,6 @@ m_myImage.ReleaseDC();
117117
118118
When you use `CImage` in an MFC project, note which member functions in your project expect a pointer to a [CBitmap](../../mfc/reference/cbitmap-class.md) object. If you want to use `CImage` with such a function, like [CMenu::AppendMenu](../../mfc/reference/cmenu-class.md#appendmenu), use [CBitmap::FromHandle](../../mfc/reference/cbitmap-class.md#fromhandle), pass it your `CImage` HBITMAP, and use the returned `CBitmap*`.
119119
120-
## Example
121-
122120
```cpp
123121
void CMyDlg::OnRButtonDown(UINT nFlags, CPoint point)
124122
{

docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can minimize the performance impact by linking with **/CLRSUPPORTLASTERROR:S
4040

4141
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
4242

43-
## Example
43+
## Examples
4444

4545
The following sample defines a native DLL with one exported function that modifies last error.
4646

@@ -57,8 +57,6 @@ __declspec(dllexport) double MySqrt(__int64 n) {
5757
}
5858
```
5959
60-
## Example
61-
6260
The following sample consumes the DLL, demonstrating how to use **/CLRSUPPORTLASTERROR**.
6361
6462
```cpp

docs/build/reference/fe-name-exe-file.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ If you specify the [/c (Compile Without Linking)](c-compile-without-linking.md)
3939

4040
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.OutputFile%2A>.
4141

42-
## Example
42+
## Examples
4343

4444
The following command line compiles and links all C source files in the current directory. The resulting executable file is named PROCESS.exe and is created in the directory "C:\Users\User Name\repos\My Project\bin".
4545

4646
```
4747
CL /Fe"C:\Users\User Name\repos\My Project\bin\PROCESS" *.C
4848
```
4949

50-
## Example
51-
5250
The following command line creates an executable file in `C:\BIN` with the same base name as the first source file in the current directory:
5351

5452
```

docs/c-runtime-library/reference/beginthread-beginthreadex.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Multithreaded versions of the [C run-time libraries](../../c-runtime-library/crt
124124

125125
To use **_beginthread** or **_beginthreadex**, the application must link with one of the multithreaded C run-time libraries.
126126

127-
## Example
127+
## Examples
128128

129129
The following example uses **_beginthread** and **_endthread**.
130130

@@ -244,8 +244,6 @@ void Bounce( void * parg )
244244
245245
Press any key to end the sample application.
246246
247-
## Example
248-
249247
The following sample code demonstrates how you can use the thread handle that's returned by **_beginthreadex** with the synchronization API [WaitForSingleObject](/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject). The main thread waits for the second thread to terminate before it continues. When the second thread calls **_endthreadex**, it causes its thread object to go to the signaled state. This allows the primary thread to continue running. This cannot be done with **_beginthread** and **_endthread**, because **_endthread** calls **CloseHandle**, which destroys the thread object before it can be set to the signaled state.
250248
251249
```cpp

docs/code-quality/c26100.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: 470ab2b2-5b55-424f-b192-3863a773c892
1212
1313
The `_Guarded_by_` annotation in the code specifies the lock to use to guard a shared variable. Warning C26100 is generated when the guard contract is violated.
1414

15-
## Example
15+
## Examples
1616

1717
The following example generates warning C26100 because there is a violation of the `_Guarded_by_` contract.
1818

@@ -44,8 +44,6 @@ void Unsafe(DATA* p) {
4444
4545
The contract violation occurs because an incorrect lock is used in the function `Unsafe`. In this case, `gCS` is the correct lock to use.
4646
47-
## Example
48-
4947
Occasionally a shared variable only has to be guarded for write access but not for read access. In that case, use the `_Write_guarded_by_` annotation, as shown in the following example.
5048
5149
```cpp

docs/code-quality/c26117.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: cc7ebc8d-9826-4cad-a4d5-2d3ad5896734
1212
1313
Enforcement of syntactically scoped lock *acquire* and lock *release* pairs in C/C++ programs is not performed by the language. A function may introduce a locking side effect by making an observable modification to the concurrency state. For example, a lock wrapper function increments the number of lock acquisitions, or lock count, for a given lock.You can annotate a function that has a side effect from a lock acquire or lock release by using `_Acquires_lock_` or `_Releases_lock_`, respectively. Without such annotations, a function is expected not to change any lock count after it returns. If acquires and releases are not balanced, they are considered to be *orphaned*. Warning C26117 is issued when a function that has not been annotated with `_Releases_lock_` releases a lock that it doesn't hold, because the function must own the lock before it releases it.
1414

15-
## Example
15+
## Examples
1616

1717
The following example generates warning C26117 because the function `ReleaseUnheldLock` releases a lock that it doesn't necessarily hold—the state of `flag` is ambiguous—and there is no annotation that specifies that it should.
1818

@@ -34,8 +34,6 @@ void ReleaseUnheldLock(DATA* p)
3434
}
3535
```
3636
37-
## Example
38-
3937
The following code fixes the problem by guaranteeing that the released lock is also acquired under the same conditions.
4038
4139
```cpp

docs/code-quality/c26130.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: 535e2356-bc84-4549-983d-7d29aee2249c
1212
1313
Warning C26130 is issued when the analyzer detects a potential race condition but infers that the function is likely to be run in a single threaded mode, for example, when the function is in the initialization stage based on certain heuristics.
1414

15-
## Example
15+
## Examples
1616

1717
In the following example, warning C26130 is generated because a `_Guarded_by_` member is being modified without a lock.
1818

@@ -29,8 +29,6 @@ void Init(DATA* p)
2929
}
3030
```
3131
32-
## Example
33-
3432
If the previous code is guaranteed to be operated in a single threaded mode, annotate the function by using `_No_competing_thread_`, as shown in the following example.
3533
3634
```cpp
@@ -46,8 +44,6 @@ _No_competing_thread_ void Init(DATA* p)
4644
}
4745
```
4846

49-
## Example
50-
5147
Alternatively, you can annotate a code fragment by using `_No_competing_thread_begin_` and `_No_competing_thread_end_`, as follows.
5248

5349
```cpp

docs/code-quality/c26135.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: e9515189-8d21-473b-89f4-8b92ebd3a4f1
1212
1313
Warning C26135 is issued when the analyzer infers that a function is a lock wrapper function that has a lock acquire or lock release side effect. If the code is not intended to be a wrapper function, then either the lock is leaking (if the lock is being acquired) or it is being released incorrectly (if the lock is being released).
1414

15-
## Example
15+
## Examples
1616

1717
The following example generates warning C26135 because an appropriate side effect annotation is missing.
1818

@@ -37,8 +37,6 @@ void MyLeave(DATA* p)
3737
}
3838
```
3939
40-
## Example
41-
4240
Warning C26135 is also issued when a conditional locking side effect is detected. To annotate a conditional effect, use the `_When_(ConditionExpr, LockAnnotation)` annotation, where `LockAnnotation` is either `_Acquires_lock_` or `_Releases_lock_` and the predicate expression `ConditionExpr` is a Boolean conditional expression. The side effects of other annotations on the same function only occur when `ConditionExpr` evaluates to true. Because `ConditionExpr` is used to relay the condition back to the caller, it must involve variables that are recognized in the calling context. These include function parameters, global or class member variables, or the return value. To see the return value, use a special keyword in the annotation, **`return`**, as shown in the following example.
4341
4442
```cpp

docs/code-quality/c26138.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.author: sunnych
1313
1414
Warning C26138 warns when a coroutine is suspended while holding a lock. In general, we can't know how long will a coroutine remain in the suspended state so this pattern may result in longer critical sections than expected.
1515

16-
## Example
16+
## Examples
1717

1818
The following code will generate C26138.
1919

@@ -44,8 +44,6 @@ generator<int> mutex_acquiring_generator_report_once() {
4444
}
4545
```
4646
47-
## Example
48-
4947
The following code will correct these warnings.
5048
5149
```cpp

docs/code-quality/c26160.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: e6518687-36b4-4eae-a732-758881638295
1212
1313
Warning C26160 resembles warning [C26110](../code-quality/c26110.md) except that the confidence level is lower. For example, the function may contain annotation errors.
1414

15-
## Example
15+
## Examples
1616

1717
The following code generates warning C26160.
1818

@@ -46,8 +46,6 @@ struct Account
4646
};
4747
```
4848
49-
## Example
50-
5149
The following code shows a solution to the previous example.
5250
5351
```cpp

0 commit comments

Comments
 (0)