Skip to content

Commit 119a7bb

Browse files
committed
Cleanup clang-tidy warning about enum sizes
1 parent 9c5a4cf commit 119a7bb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.clang-tidy

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Checks: >-
3434
-modernize-pass-by-value,
3535
3636
performance-*,
37-
-performance-enum-size,
37+
performance-enum-size,
3838
3939
portability-*,
4040
@@ -49,6 +49,7 @@ Checks: >-
4949
-readability-implicit-bool-conversion,
5050
-readability-isolate-declaration,
5151
-readability-magic-numbers,
52+
-readability-math-missing-parentheses, #no, 'a + B * C' obeying math rules is not confusing,
5253
-readability-named-parameter,
5354
-readability-qualified-auto,
5455
-readability-redundant-access-specifiers,

src/catch2/catch_tostring.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ namespace Detail {
2222
const int hexThreshold = 255;
2323

2424
struct Endianness {
25-
enum Arch { Big, Little };
25+
enum Arch : uint8_t {
26+
Big,
27+
Little
28+
};
2629

2730
static Arch which() {
2831
int one = 1;

src/catch2/reporters/catch_reporter_console.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct RowBreak {};
214214
struct OutputFlush {};
215215

216216
class Duration {
217-
enum class Unit {
217+
enum class Unit : uint8_t {
218218
Auto,
219219
Nanoseconds,
220220
Microseconds,
@@ -286,7 +286,10 @@ class Duration {
286286
};
287287
} // end anon namespace
288288

289-
enum class Justification { Left, Right };
289+
enum class Justification : uint8_t {
290+
Left,
291+
Right
292+
};
290293

291294
struct ColumnInfo {
292295
std::string name;

0 commit comments

Comments
 (0)