Skip to content

Commit df6d9d3

Browse files
authored
Merge pull request #1740 from su2code/fix_some_warnings
Fix misleading indentation warnings (GCC 11.2)
2 parents 745e5d9 + 968ebe6 commit df6d9d3

2 files changed

Lines changed: 35 additions & 35 deletions

File tree

Common/include/parallelization/special_vectorization.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,24 @@ MAKE_BINARY_FUN(min, min_p)
138138

139139
/*--- Functions of one (array) argument. ---*/
140140

141-
#define MAKE_UNARY_FUN(NAME,IMPL) \
142-
FORCEINLINE ARRAY_T NAME(const ARRAY_T& x) { \
143-
ARRAY_T res; FOREACH res[k] = IMPL(x[k]); return res; \
141+
#define MAKE_UNARY_FUN(NAME,IMPL) \
142+
FORCEINLINE ARRAY_T NAME(const ARRAY_T& x) { \
143+
ARRAY_T res; FOREACH { res[k] = IMPL(x[k]); } return res; \
144144
}
145145

146146
#undef MAKE_UNARY_FUN
147147

148148
/*--- Functions of two arguments, with arrays and scalars. ---*/
149149

150-
#define MAKE_BINARY_FUN(NAME,IMPL) \
151-
FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, const ARRAY_T& b) { \
152-
ARRAY_T res; FOREACH res[k] = IMPL(a[k], b[k]); return res; \
153-
} \
154-
FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, SCALAR_T b) { \
155-
ARRAY_T res; FOREACH res[k] = IMPL(a[k], b); return res; \
156-
} \
157-
FORCEINLINE ARRAY_T NAME(SCALAR_T b, const ARRAY_T& a) { \
158-
ARRAY_T res; FOREACH res[k] = IMPL(b, a[k]); return res; \
150+
#define MAKE_BINARY_FUN(NAME,IMPL) \
151+
FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, const ARRAY_T& b) { \
152+
ARRAY_T res; FOREACH { res[k] = IMPL(a[k], b[k]); } return res; \
153+
} \
154+
FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, SCALAR_T b) { \
155+
ARRAY_T res; FOREACH { res[k] = IMPL(a[k], b); } return res; \
156+
} \
157+
FORCEINLINE ARRAY_T NAME(SCALAR_T b, const ARRAY_T& a) { \
158+
ARRAY_T res; FOREACH { res[k] = IMPL(b, a[k]); } return res; \
159159
}
160160

161161
MAKE_BINARY_FUN(pow, ::pow)

Common/include/parallelization/vectorization.hpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@ class Array : public CVecExpr<Array<Scalar_t,N>, Scalar_t> {
8282
alignas(Size*sizeof(Scalar)) Scalar x_[N];
8383

8484
public:
85-
#define ARRAY_BOILERPLATE \
86-
/*!--- Access elements ---*/ \
87-
FORCEINLINE Scalar& operator[] (size_t k) { return x_[k]; } \
88-
FORCEINLINE const Scalar& operator[] (size_t k) const { return x_[k]; } \
89-
/*!--- Constructors ---*/ \
90-
FORCEINLINE Array() = default; \
91-
FORCEINLINE Array(Scalar x) { bcast(x); } \
92-
FORCEINLINE Array(std::initializer_list<Scalar> vals) { \
93-
auto it = vals.begin(); FOREACH { x_[k] = *it; ++it; } \
94-
} \
95-
FORCEINLINE Array(Scalar x0, Scalar dx) { FOREACH x_[k] = x0 + k*dx; } \
96-
FORCEINLINE Array(const Scalar* ptr) { load(ptr); } \
97-
template<class T> \
98-
FORCEINLINE Array(const Scalar* beg, const T& off) { gather(beg,off); } \
99-
/*!--- Reduction operations ---*/ \
100-
FORCEINLINE Scalar sum() const { Scalar s(0); FOREACH s+=x_[k]; return s; } \
101-
FORCEINLINE Scalar dot(const Array& other) const { \
102-
Scalar s(0); FOREACH s += x_[k] * other[k]; return s; \
85+
#define ARRAY_BOILERPLATE \
86+
/*!--- Access elements ---*/ \
87+
FORCEINLINE Scalar& operator[] (size_t k) { return x_[k]; } \
88+
FORCEINLINE const Scalar& operator[] (size_t k) const { return x_[k]; } \
89+
/*!--- Constructors ---*/ \
90+
FORCEINLINE Array() = default; \
91+
FORCEINLINE Array(Scalar x) { bcast(x); } \
92+
FORCEINLINE Array(std::initializer_list<Scalar> vals) { \
93+
auto it = vals.begin(); FOREACH { x_[k] = *it; ++it; } \
94+
} \
95+
FORCEINLINE Array(Scalar x0, Scalar dx) { FOREACH x_[k] = x0 + k*dx; } \
96+
FORCEINLINE Array(const Scalar* ptr) { load(ptr); } \
97+
template<class T> \
98+
FORCEINLINE Array(const Scalar* beg, const T& off) { gather(beg,off); } \
99+
/*!--- Reduction operations ---*/ \
100+
FORCEINLINE Scalar sum() const { Scalar s(0); FOREACH { s+=x_[k]; } return s; } \
101+
FORCEINLINE Scalar dot(const Array& other) const { \
102+
Scalar s(0); FOREACH { s += x_[k] * other[k]; } return s; \
103103
}
104104

105105
#if defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)
@@ -132,11 +132,11 @@ class Array : public CVecExpr<Array<Scalar_t,N>, Scalar_t> {
132132

133133
/*--- Compound assignment operators. ---*/
134134

135-
#define MAKE_COMPOUND(OP) \
136-
FORCEINLINE Array& operator OP (Scalar x) { FOREACH x_[k] OP x; return *this; } \
137-
template<class U> \
138-
FORCEINLINE Array& operator OP (const CVecExpr<U,Scalar>& expr) { \
139-
FOREACH x_[k] OP expr.derived()[k]; return *this; \
135+
#define MAKE_COMPOUND(OP) \
136+
FORCEINLINE Array& operator OP (Scalar x) { FOREACH { x_[k] OP x; } return *this; } \
137+
template<class U> \
138+
FORCEINLINE Array& operator OP (const CVecExpr<U,Scalar>& expr) { \
139+
FOREACH { x_[k] OP expr.derived()[k]; } return *this; \
140140
}
141141
MAKE_COMPOUND(=)
142142
MAKE_COMPOUND(+=)

0 commit comments

Comments
 (0)