Skip to content

Commit 910b172

Browse files
Fix Acrolinx and grammar issues
1 parent 458e0ed commit 910b172

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

docs/code-quality/c26813.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26813"
33
title: c26813
4-
keywords: c26813
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26813"]
87
helpviewer_keywords: ["C26813"]
9-
dev_langs: ["C++"]
108
---
119
# C26813
1210

1311
> Warning C26813: Use 'bitwise and' to check if a flag is set
1412
15-
Most `enum`s with power of two member values are intended to be used with bit flags. As a result, we rarely want to equality compare these flags. We want to extract the bits we are interested in using bitwise operations instead.
13+
Most `enum` types with power of two member values are intended to be used as bit flags. As a result, you rarely want to compare these flags for equality. Instead, extract the bits you're interested in by using bitwise operations.
1614

1715
## Example
1816

@@ -41,8 +39,7 @@ void useEqualsWithBitwiseEnum(BitWise a)
4139
}
4240
```
4341

44-
4542
## See also
4643

47-
[C26827](./c26827.md)
44+
[C26827](./c26827.md)\
4845
[C26828](./c26828.md)

docs/code-quality/c26827.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26827"
33
title: c26827
4-
keywords: c26814
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26827"]
87
helpviewer_keywords: ["C26827"]
9-
dev_langs: ["C++"]
108
---
119
# C26827
1210

13-
> Warning C26827: Did you forgot to initialize an enum or wanted to use another type?
11+
> Warning C26827: Did you forget to initialize an enum, or intend to use another type?
1412
15-
Most `enum` types used in bitwise operations are expected to have members with values of powers of two. This warning attempts to find cases where we forgot to give a value to an enum constant explicitly or inadvertently used the wrong enum type.
13+
Most `enum` types used in bitwise operations are expected to have members with values of powers of two. This warning attempts to find cases where a value wasn't given explicitly to an enumeration constant. It also finds cases where the wrong enumeration type may have been used inadvertently.
1614

1715
## Example
1816

@@ -27,11 +25,11 @@ enum class AlmostBitWise
2725

2826
int almostBitwiseEnums(AlmostBitWise a, bool cond)
2927
{
30-
return (int)a|(int)AlmostBitWise::A; // Warning C26827: Did you forgot to initialize an enum or wanted to use another type?
28+
return (int)a|(int)AlmostBitWise::A; // Warning C26827: Did you forget to initialize an enum, or intend to use another type?
3129
}
3230
```
3331
34-
To fix the warning, initialize the enum constant to the correct value or use the correct enum type in the operation.
32+
To fix the warning, initialize the enumeration constant to the correct value, or use the correct enumeration type in the operation.
3533
3634
```cpp
3735
enum class AlmostBitWise
@@ -50,5 +48,5 @@ int almostBitwiseEnums(AlmostBitWise a, bool cond)
5048

5149
## See also
5250

53-
[C26813](./c26813.md)
51+
[C26813](./c26813.md)\
5452
[C26828](./c26828.md)

docs/code-quality/c26828.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
22
description: "Learn more about: C26828"
33
title: c26828
4-
keywords: c26828
5-
ms.date: 02/23/2022
4+
ms.date: 03/02/2022
65
ms.topic: reference
76
f1_keywords: ["C26828"]
87
helpviewer_keywords: ["C26828"]
9-
dev_langs: ["C++"]
108
---
119
# C26828
1210

1311
> Warning C26828: Different enum types have overlapping values. Did you want to use another enum constant here?
1412
15-
Most of the times we use a single enum to describe all the bit flags we can use for an option. If we use two different enum types in the same bitwise expression where the enums have overlapping values the chances are good those enums were not designed to be used in the expression.
13+
Most of the time, a single enumeration type describes all the bit flags that you can use for an option. If you use two different enumeration types that have overlapping values in the same bitwise expression, the chances are good those enumeration types weren't designed for use together.
1614

1715
## Example
1816

@@ -39,7 +37,7 @@ int overlappingBitwiseEnums(BitWiseA a)
3937
}
4038
```
4139
42-
To fix the warning make sure `enum`s that are designed to be used together have no overlapping values or make sure all the related options are in a single `enum`.
40+
To fix the warning. make sure enumeration types designed for use together have no overlapping values. Or, make sure all the related options are in a single enumeration type.
4341
4442
```cpp
4543
@@ -58,6 +56,5 @@ int overlappingBitwiseEnums(BitWiseA a)
5856

5957
## See also
6058

61-
[C26813](./c26813.md)
59+
[C26813](./c26813.md)\
6260
[C26827](./c26827.md)
63-

0 commit comments

Comments
 (0)