mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 22:23: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(
|
||||
STACK_MAIN 4096
|
||||
STACK_MAX 2450
|
||||
COMPILE_FLAGS
|
||||
-Wno-sign-compare # TODO: fix all sign-compare
|
||||
SRCS
|
||||
accelerometer_calibration.cpp
|
||||
airspeed_calibration.cpp
|
||||
|
||||
@@ -488,7 +488,7 @@ calibrate_return do_accel_calibration_measurements(orb_advert_t *mavlink_log_pub
|
||||
// and match it up with the one from the uORB subscription, because the
|
||||
// instance ordering of uORB and the order of the FDs may not be the same.
|
||||
|
||||
if(report.device_id == device_id[cur_accel]) {
|
||||
if (report.device_id == (uint32_t)device_id[cur_accel]) {
|
||||
// Device IDs match, correct ORB instance for this accel
|
||||
found_cur_accel = true;
|
||||
// store initial timestamp - used to infer which sensors are active
|
||||
|
||||
@@ -238,7 +238,7 @@ int sphere_fit_least_squares(const float x[], const float y[], const float z[],
|
||||
}
|
||||
|
||||
int ellipsoid_fit_least_squares(const float x[], const float y[], const float z[],
|
||||
unsigned int size, unsigned int max_iterations, float delta, float *offset_x, float *offset_y, float *offset_z,
|
||||
unsigned int size, int max_iterations, float delta, float *offset_x, float *offset_y, float *offset_z,
|
||||
float *sphere_radius, float *diag_x, float *diag_y, float *diag_z, float *offdiag_x, float *offdiag_y, float *offdiag_z)
|
||||
{
|
||||
float _fitness = 1.0e30f, _sphere_lambda = 1.0f, _ellipsoid_lambda = 1.0f;
|
||||
|
||||
@@ -58,7 +58,7 @@ int sphere_fit_least_squares(const float x[], const float y[], const float z[],
|
||||
unsigned int size, unsigned int max_iterations, float delta, float *sphere_x, float *sphere_y, float *sphere_z,
|
||||
float *sphere_radius);
|
||||
int ellipsoid_fit_least_squares(const float x[], const float y[], const float z[],
|
||||
unsigned int size, unsigned int max_iterations, float delta, float *offset_x, float *offset_y, float *offset_z,
|
||||
unsigned int size, int max_iterations, float delta, float *offset_x, float *offset_y, float *offset_z,
|
||||
float *sphere_radius, float *diag_x, float *diag_y, float *diag_z, float *offdiag_x, float *offdiag_y,
|
||||
float *offdiag_z);
|
||||
int run_lm_sphere_fit(const float x[], const float y[], const float z[], float &_fitness, float &_sphere_lambda,
|
||||
|
||||
@@ -1306,8 +1306,8 @@ Commander::run()
|
||||
|
||||
/* Start monitoring loop */
|
||||
unsigned counter = 0;
|
||||
unsigned stick_off_counter = 0;
|
||||
unsigned stick_on_counter = 0;
|
||||
int stick_off_counter = 0;
|
||||
int stick_on_counter = 0;
|
||||
|
||||
bool low_battery_voltage_actions_done = false;
|
||||
bool critical_battery_voltage_actions_done = false;
|
||||
@@ -3076,7 +3076,7 @@ Commander::set_main_state_rc(const vehicle_status_s &status_local, bool *changed
|
||||
/* we know something has changed - check if we are in mode slot operation */
|
||||
if (sp_man.mode_slot != manual_control_setpoint_s::MODE_SLOT_NONE) {
|
||||
|
||||
if (sp_man.mode_slot >= sizeof(_flight_mode_slots) / sizeof(_flight_mode_slots[0])) {
|
||||
if (sp_man.mode_slot >= (int)(sizeof(_flight_mode_slots) / sizeof(_flight_mode_slots[0]))) {
|
||||
warnx("m slot overflow");
|
||||
return TRANSITION_DENIED;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
// and match it up with the one from the uORB subscription, because the
|
||||
// instance ordering of uORB and the order of the FDs may not be the same.
|
||||
|
||||
if(report.device_id == worker_data.device_id[cur_gyro]) {
|
||||
if (report.device_id == (uint32_t)worker_data.device_id[cur_gyro]) {
|
||||
// Device IDs match, correct ORB instance for this gyro
|
||||
found_cur_gyro = true;
|
||||
} else {
|
||||
|
||||
@@ -609,7 +609,7 @@ calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub)
|
||||
// and match it up with the one from the uORB subscription, because the
|
||||
// instance ordering of uORB and the order of the FDs may not be the same.
|
||||
|
||||
if(report.device_id == device_ids[cur_mag]) {
|
||||
if (report.device_id == (uint32_t)device_ids[cur_mag]) {
|
||||
// Device IDs match, correct ORB instance for this mag
|
||||
found_cur_mag = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user