mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 05:53:34 +08:00
fix all sign-compare warnings
This commit is contained in:
committed by
Lorenz Meier
parent
cf74166801
commit
9ce83f2208
@@ -36,7 +36,6 @@ px4_add_module(
|
||||
MAIN send_event
|
||||
STACK_MAIN 2200
|
||||
COMPILE_FLAGS
|
||||
-Wno-sign-compare # TODO: fix all sign-compare
|
||||
SRCS
|
||||
send_event.cpp
|
||||
temperature_calibration/accel.cpp
|
||||
|
||||
@@ -112,7 +112,7 @@ Author: Siddharth Bharat Purohit
|
||||
#define PF_DEBUG(fmt, ...)
|
||||
#endif
|
||||
|
||||
template<size_t _forder>
|
||||
template<int _forder>
|
||||
class polyfitter
|
||||
{
|
||||
public:
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
|
||||
IVTV = _VTV.I();
|
||||
|
||||
for (unsigned i = 0; i < _forder; i++) {
|
||||
for (int i = 0; i < _forder; i++) {
|
||||
for (int j = 0; j < _forder; j++) {
|
||||
PF_DEBUG("%.10f ", (double)IVTV(i, j));
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
PF_DEBUG("\n");
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < _forder; i++) {
|
||||
for (int i = 0; i < _forder; i++) {
|
||||
res[i] = 0.0;
|
||||
|
||||
for (int j = 0; j < _forder; j++) {
|
||||
@@ -161,7 +161,7 @@ private:
|
||||
double temp = 1.0;
|
||||
PF_DEBUG("O %.6f\n", (double)x);
|
||||
|
||||
for (int8_t i = _forder - 1; i >= 0; i--) {
|
||||
for (int i = _forder - 1; i >= 0; i--) {
|
||||
_VTY(i) += y * temp;
|
||||
temp *= x;
|
||||
PF_DEBUG("%.6f ", (double)_VTY(i));
|
||||
@@ -175,7 +175,7 @@ private:
|
||||
double temp = 1.0;
|
||||
int8_t z;
|
||||
|
||||
for (unsigned i = 0; i < _forder; i++) {
|
||||
for (int i = 0; i < _forder; i++) {
|
||||
for (int j = 0; j < _forder; j++) {
|
||||
PF_DEBUG("%.10f ", (double)_VTV(i, j));
|
||||
}
|
||||
@@ -183,7 +183,7 @@ private:
|
||||
PF_DEBUG("\n");
|
||||
}
|
||||
|
||||
for (int8_t i = 2 * _forder - 2; i >= 0; i--) {
|
||||
for (int i = 2 * _forder - 2; i >= 0; i--) {
|
||||
if (i < _forder) {
|
||||
z = 0.0f;
|
||||
|
||||
@@ -192,8 +192,8 @@ private:
|
||||
}
|
||||
|
||||
for (int j = i - z; j >= z; j--) {
|
||||
unsigned row = j;
|
||||
unsigned col = i - j;
|
||||
int row = j;
|
||||
int col = i - j;
|
||||
_VTV(row, col) += (double)temp;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ void TemperatureCalibration::task_main()
|
||||
if (!_gyro) {
|
||||
sensor_gyro_s gyro_data;
|
||||
|
||||
for (int i = 0; i < num_gyro; ++i) {
|
||||
for (unsigned i = 0; i < num_gyro; ++i) {
|
||||
orb_copy(ORB_ID(sensor_gyro), gyro_sub[i], &gyro_data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user