Skip to content

Commit

Permalink
refactor: fix cppcoreguidelines-macro-to-enum lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Oct 16, 2024
1 parent af7db70 commit ec40d60
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Checks: >-
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-macro-to-enum,
google*,
-google-build-using-namespace,
hicpp*,
Expand Down
4 changes: 2 additions & 2 deletions src/htif-defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#ifndef HTIF_DEFINES_H
#define HTIF_DEFINES_H
// NOLINTBEGIN(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTBEGIN(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
#define HTIF_DEV_SHIFT_DEF 56
#define HTIF_CMD_SHIFT_DEF 48
#define HTIF_REASON_SHIFT_DEF 32
Expand Down Expand Up @@ -49,6 +49,6 @@
/* reply */
#define HTIF_YIELD_REASON_ADVANCE_STATE_DEF 0
#define HTIF_YIELD_REASON_INSPECT_STATE_DEF 1
// NOLINTEND(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTEND(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)

#endif /* end of include guard: HTIF_DEFINES_H */
4 changes: 2 additions & 2 deletions src/pma-defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#ifndef PMA_DEFINES_H
#define PMA_DEFINES_H
// NOLINTBEGIN(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTBEGIN(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
#define PMA_SHADOW_STATE_START_DEF 0x0 ///< Shadow start address
#define PMA_SHADOW_STATE_LENGTH_DEF 0x1000 ///< Shadow length in bytes
#define PMA_SHADOW_PMAS_START_DEF 0x10000 ///< PMA Array start address
Expand Down Expand Up @@ -70,5 +70,5 @@
#ifndef EXPAND_UINT64_C
#define EXPAND_UINT64_C(a) UINT64_C(a)
#endif
// NOLINTEND(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTEND(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
#endif /* end of include guard: PMA_DEFINES_H */
4 changes: 2 additions & 2 deletions src/rtc-defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#ifndef RTC_DEFINES_H
#define RTC_DEFINES_H
// NOLINTBEGIN(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTBEGIN(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)

/// \brief Number of cycles between RTC ticks
/// Changing this value affects the machine state hash
Expand All @@ -27,5 +27,5 @@
/// \brief Arbitrary CPU clock frequency.
/// We have to make sure the clock frequency is divisible by RTC_FREQ_DIV_DEF and 10^6
#define RTC_CLOCK_FREQ_DEF 128000000 ///< 128 MHz frequency
// NOLINTEND(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTEND(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
#endif /* end of include guard: RTC_DEFINES_H */
4 changes: 2 additions & 2 deletions src/uarch-defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define UARCH_DEFINES_H

#include "pma-defines.h"
// NOLINTBEGIN(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTBEGIN(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
/// \brief Start address of the entire uarch memory range: shadow and ram
#define UARCH_STATE_START_ADDRESS_DEF PMA_SHADOW_UARCH_STATE_START_DEF

Expand All @@ -29,5 +29,5 @@
#define UARCH_ECALL_FN_HALT_DEF 1 // halt uarch
#define UARCH_ECALL_FN_PUTCHAR_DEF 2 // putchar

// NOLINTEND(cppcoreguidelines-macro-usage,modernize-macro-to-enum)
// NOLINTEND(cppcoreguidelines-macro-usage,cppcoreguidelines-macro-to-enum,modernize-macro-to-enum)
#endif /* end of include guard: UARCH_DEFINES_H */

0 comments on commit ec40d60

Please sign in to comment.