Skip to content

Commit

Permalink
Cleanup clang-tidy warning about enum sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Oct 29, 2024
1 parent 9c5a4cf commit 119a7bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Checks: >-
-modernize-pass-by-value,
performance-*,
-performance-enum-size,
performance-enum-size,
portability-*,
Expand All @@ -49,6 +49,7 @@ Checks: >-
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-math-missing-parentheses, #no, 'a + B * C' obeying math rules is not confusing,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
Expand Down
5 changes: 4 additions & 1 deletion src/catch2/catch_tostring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ namespace Detail {
const int hexThreshold = 255;

struct Endianness {
enum Arch { Big, Little };
enum Arch : uint8_t {
Big,
Little
};

static Arch which() {
int one = 1;
Expand Down
7 changes: 5 additions & 2 deletions src/catch2/reporters/catch_reporter_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ struct RowBreak {};
struct OutputFlush {};

class Duration {
enum class Unit {
enum class Unit : uint8_t {
Auto,
Nanoseconds,
Microseconds,
Expand Down Expand Up @@ -286,7 +286,10 @@ class Duration {
};
} // end anon namespace

enum class Justification { Left, Right };
enum class Justification : uint8_t {
Left,
Right
};

struct ColumnInfo {
std::string name;
Expand Down

0 comments on commit 119a7bb

Please sign in to comment.