Fix clang-tidy cppcoreguidelines-macro-usage findings (macros as constants)

This commit is contained in:
Tim Wojtulewicz 2025-05-09 11:57:58 -07:00
parent d6d56d330b
commit ad99a6821e
16 changed files with 96 additions and 80 deletions

View file

@ -123,11 +123,11 @@ int icmp6_checksum(const struct icmp* icmpp, const IP_Hdr* ip, int len) {
len);
}
#define CLASS_A 0x00000000
#define CLASS_B 0x80000000
#define CLASS_C 0xc0000000
#define CLASS_D 0xe0000000
#define CLASS_E 0xf0000000
constexpr uint32_t CLASS_A = 0x00000000;
constexpr uint32_t CLASS_B = 0x80000000;
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) {