mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +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:
parent
0fd99c59f1
commit
7a3009f7a3
@ -96,9 +96,7 @@ public:
|
||||
|
||||
inline const Type &operator()(size_t i, size_t j) const
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < M);
|
||||
assert(j >= 0);
|
||||
assert(j < N);
|
||||
|
||||
return _data[i][j];
|
||||
@ -106,9 +104,7 @@ public:
|
||||
|
||||
inline Type &operator()(size_t i, size_t j)
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < M);
|
||||
assert(j >= 0);
|
||||
assert(j < N);
|
||||
|
||||
return _data[i][j];
|
||||
@ -494,9 +490,7 @@ public:
|
||||
|
||||
inline void swapRows(size_t a, size_t b)
|
||||
{
|
||||
assert(a >= 0);
|
||||
assert(a < M);
|
||||
assert(b >= 0);
|
||||
assert(b < M);
|
||||
|
||||
if (a == b) {
|
||||
@ -514,9 +508,7 @@ public:
|
||||
|
||||
inline void swapCols(size_t a, size_t b)
|
||||
{
|
||||
assert(a >= 0);
|
||||
assert(a < N);
|
||||
assert(b >= 0);
|
||||
assert(b < N);
|
||||
|
||||
if (a == b) {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -136,7 +136,6 @@ public:
|
||||
void uncorrelateCovariance(size_t first)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -148,7 +147,6 @@ public:
|
||||
void uncorrelateCovarianceSetVariance(size_t first, const Vector<Type, Width> &vec)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -168,7 +166,6 @@ public:
|
||||
void uncorrelateCovarianceSetVariance(size_t first, Type val)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -187,7 +184,6 @@ public:
|
||||
void makeBlockSymmetric(size_t first)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -207,7 +203,6 @@ public:
|
||||
void makeRowColSymmetric(size_t first)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -231,7 +226,6 @@ public:
|
||||
bool isBlockSymmetric(size_t first, const Type eps = 1e-8f)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
@ -252,7 +246,6 @@ public:
|
||||
bool isRowColSymmetric(size_t first, const Type eps = 1e-8f)
|
||||
{
|
||||
static_assert(Width <= M, "Width bigger than matrix");
|
||||
assert(first >= 0);
|
||||
assert(first + Width <= M);
|
||||
|
||||
SquareMatrix<Type, M> &self = *this;
|
||||
|
||||
@ -42,7 +42,6 @@ public:
|
||||
|
||||
inline const Type &operator()(size_t i) const
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < M);
|
||||
|
||||
const MatrixM1 &v = *this;
|
||||
@ -51,7 +50,6 @@ public:
|
||||
|
||||
inline Type &operator()(size_t i)
|
||||
{
|
||||
assert(i >= 0);
|
||||
assert(i < M);
|
||||
|
||||
MatrixM1 &v = *this;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user