mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 14:53:35 +08:00
Remove asserts for unsigned integer >= 0
GCC 10 gives a warning "comparison of unsigned expression in ‘>= 0’ is always true" for these asserts since checking if an unsigned integer cannot be negative and hence the statement gets droped.
This commit is contained in:
committed by
Julian Kent
parent
0fd99c59f1
commit
7a3009f7a3
@@ -28,17 +28,13 @@ public:
|
||||
_data(const_cast<Matrix<Type, M, N>*>(data)) {
|
||||
static_assert(P <= M, "Slice rows bigger than backing matrix");
|
||||
static_assert(Q <= N, "Slice cols bigger than backing matrix");
|
||||
assert(x0 >= 0);
|
||||
assert(x0 + P <= M);
|
||||
assert(y0 >= 0);
|
||||
assert(y0 + Q <= N);
|
||||
}
|
||||
|
||||
const Type &operator()(size_t i, size_t j) const
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < P);
|
||||
assert(j >= 0);
|
||||
assert(j < Q);
|
||||
|
||||
return (*_data)(_x0 + i, _y0 + j);
|
||||
@@ -47,9 +43,7 @@ public:
|
||||
Type &operator()(size_t i, size_t j)
|
||||
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < P);
|
||||
assert(j >= 0);
|
||||
assert(j < Q);
|
||||
|
||||
return (*_data)(_x0 + i, _y0 + j);
|
||||
|
||||
Reference in New Issue
Block a user