mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Fix clang-tidy cppcoreguidelines-macro-usage findings (macro functions)
This commit is contained in:
parent
ad99a6821e
commit
460fe24a9a
23 changed files with 75 additions and 47 deletions
|
@ -42,6 +42,8 @@ static VectorTypePtr base_vector_type__CPP(const VectorTypePtr& vt, bool is_bool
|
|||
}
|
||||
}
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
|
||||
|
||||
// The kernel used for unary vector operations.
|
||||
#define VEC_OP1_KERNEL(accessor, type, op) \
|
||||
for ( unsigned int i = 0; i < v->Size(); ++i ) { \
|
||||
|
@ -90,6 +92,8 @@ static VectorTypePtr base_vector_type__CPP(const VectorTypePtr& vt, bool is_bool
|
|||
break; \
|
||||
})
|
||||
|
||||
// NOLINTEND(cppcoreguidelines-macro-usage)
|
||||
|
||||
// The unary operations supported for vectors.
|
||||
VEC_OP1_WITH_DOUBLE(pos, +)
|
||||
VEC_OP1_WITH_DOUBLE(neg, -)
|
||||
|
@ -98,6 +102,7 @@ VEC_OP1(comp, ~, )
|
|||
|
||||
// A kernel for applying a binary operation element-by-element to two
|
||||
// vectors of a given low-level type.
|
||||
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
|
||||
// NOLINTBEGIN(bugprone-macro-parentheses)
|
||||
#define VEC_OP2_KERNEL(accessor, type, op, zero_check) \
|
||||
for ( unsigned int i = 0; i < v1->Size(); ++i ) { \
|
||||
|
@ -167,6 +172,7 @@ VEC_OP1(comp, ~, )
|
|||
break; \
|
||||
}, \
|
||||
zero_check)
|
||||
// NOLINTEND(cppcoreguidelines-macro-usage)
|
||||
|
||||
// The binary operations supported for vectors.
|
||||
VEC_OP2_WITH_DOUBLE(add, +, 0)
|
||||
|
@ -184,6 +190,7 @@ VEC_OP2_WITH_INT(rshift, >>, , 0)
|
|||
|
||||
// A version of VEC_OP2 that instead supports relational operations, so
|
||||
// the result type is always vector-of-bool.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
|
||||
#define VEC_REL_OP(name, op) \
|
||||
VectorValPtr vec_op_##name##__CPP(const VectorValPtr& v1, const VectorValPtr& v2) { \
|
||||
if ( ! check_vec_sizes__CPP(v1, v2) ) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue