Fix clang-tidy cppcoreguidelines-macro-usage findings (macro functions)

This commit is contained in:
Tim Wojtulewicz 2025-05-09 11:59:04 -07:00
parent ad99a6821e
commit 460fe24a9a
23 changed files with 75 additions and 47 deletions

View file

@ -129,8 +129,8 @@ constexpr uint32_t CLASS_C = 0xc0000000;
constexpr uint32_t CLASS_D = 0xe0000000;
constexpr uint32_t CLASS_E = 0xf0000000;
#define CHECK_CLASS(addr, class) (((addr) & (class)) == (class))
char addr_to_class(uint32_t addr) {
auto CHECK_CLASS = [](uint32_t addr, uint32_t cls) { return (addr & cls) == cls; };
if ( CHECK_CLASS(addr, CLASS_E) )
return 'E';
else if ( CHECK_CLASS(addr, CLASS_D) )