enable Wshadow

This commit is contained in:
Daniel Agar
2016-05-04 18:34:35 -04:00
committed by Lorenz Meier
parent e61f517bc6
commit 7aa6e85563
16 changed files with 43 additions and 32 deletions
+2
View File
@@ -36,6 +36,8 @@ px4_add_module(
STACK_MAIN 4096
STACK_MAX 2450
COMPILE_FLAGS
-Wno-attributes
-Wno-packed
-Os
SRCS
commander.cpp
+4 -4
View File
@@ -1700,7 +1700,7 @@ int commander_thread_main(int argc, char *argv[])
!armed.armed) {
bool chAirspeed = false;
bool hotplug_timeout = hrt_elapsed_time(&commander_boot_timestamp) > HOTPLUG_SENS_TIMEOUT;
hotplug_timeout = hrt_elapsed_time(&commander_boot_timestamp) > HOTPLUG_SENS_TIMEOUT;
/* Perform airspeed check only if circuit breaker is not
* engaged and it's not a rotary wing
@@ -2874,7 +2874,7 @@ check_valid(hrt_abstime timestamp, hrt_abstime timeout, bool valid_in, bool *val
}
void
control_status_leds(vehicle_status_s *status_local, const actuator_armed_s *actuator_armed, bool changed, battery_status_s *battery)
control_status_leds(vehicle_status_s *status_local, const actuator_armed_s *actuator_armed, bool changed, battery_status_s *battery_status)
{
/* driving rgbled */
if (changed) {
@@ -2907,9 +2907,9 @@ control_status_leds(vehicle_status_s *status_local, const actuator_armed_s *actu
/* set color */
if (status.failsafe) {
rgbled_set_color(RGBLED_COLOR_PURPLE);
} else if (battery->warning == battery_status_s::BATTERY_WARNING_LOW) {
} else if (battery_status->warning == battery_status_s::BATTERY_WARNING_LOW) {
rgbled_set_color(RGBLED_COLOR_AMBER);
} else if (battery->warning == battery_status_s::BATTERY_WARNING_CRITICAL) {
} else if (battery_status->warning == battery_status_s::BATTERY_WARNING_CRITICAL) {
rgbled_set_color(RGBLED_COLOR_RED);
} else {
if (status_flags.condition_home_position_valid && status_flags.condition_global_position_valid) {
+4 -4
View File
@@ -81,7 +81,7 @@ int device_prio_max = 0;
int32_t device_id_primary = 0;
static unsigned _last_mag_progress = 0;
calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub, int32_t (&device_ids)[max_mags]);
calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub);
/// Data passed to calibration worker routine
typedef struct {
@@ -117,7 +117,7 @@ int do_mag_calibration(orb_advert_t *mavlink_log_pub)
char str[30];
for (size_t i=0; i<max_mags; i++) {
for (size_t i=0; i < max_mags; i++) {
device_ids[i] = 0; // signals no mag
}
@@ -202,7 +202,7 @@ int do_mag_calibration(orb_advert_t *mavlink_log_pub)
// Calibrate all mags at the same time
if (result == OK) {
switch (mag_calibrate_all(mavlink_log_pub, device_ids)) {
switch (mag_calibrate_all(mavlink_log_pub)) {
case calibrate_return_cancelled:
// Cancel message already displayed, we're done here
result = ERROR;
@@ -435,7 +435,7 @@ static calibrate_return mag_calibration_worker(detect_orientation_return orienta
return result;
}
calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub, int32_t (&device_ids)[max_mags])
calibrate_return mag_calibrate_all(orb_advert_t *mavlink_log_pub)
{
calibrate_return result = calibrate_return_ok;
+7 -7
View File
@@ -182,13 +182,13 @@ MavlinkParametersManager::handle_message(const mavlink_message_t *msg)
uint32_t hash = param_hash_check();
/* build the one-off response message */
mavlink_param_value_t msg;
msg.param_count = param_count_used();
msg.param_index = -1;
strncpy(msg.param_id, HASH_PARAM, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
msg.param_type = MAV_PARAM_TYPE_UINT32;
memcpy(&msg.param_value, &hash, sizeof(hash));
_mavlink->send_message(MAVLINK_MSG_ID_PARAM_VALUE, &msg);
mavlink_param_value_t param_value;
param_value.param_count = param_count_used();
param_value.param_index = -1;
strncpy(param_value.param_id, HASH_PARAM, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
param_value.param_type = MAV_PARAM_TYPE_UINT32;
memcpy(&param_value.param_value, &hash, sizeof(hash));
_mavlink->send_message(MAVLINK_MSG_ID_PARAM_VALUE, &param_value);
} else {
/* local name buffer to enforce null-terminated string */
char name[MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN + 1];
+4 -4
View File
@@ -181,14 +181,14 @@ int uORBTest::UnitTest::test_unadvertise()
}
//try to advertise and see whether we get the right instance
int instance[4];
int instance_test[4];
struct orb_test t;
for (int i = 0; i < 4; ++i) {
_pfd[i] = orb_advertise_multi(ORB_ID(orb_multitest), &t, &instance[i], ORB_PRIO_MAX);
_pfd[i] = orb_advertise_multi(ORB_ID(orb_multitest), &t, &instance_test[i], ORB_PRIO_MAX);
if (instance[i] != i) {
return test_fail("got wrong instance (should be %i, is %i)", i, instance[i]);
if (instance_test[i] != i) {
return test_fail("got wrong instance (should be %i, is %i)", i, instance_test[i]);
}
}
+2
View File
@@ -59,6 +59,8 @@ px4_add_module(
STACK_MAIN 3200
STACK_MAX 1500
COMPILE_FLAGS
-Wno-attributes
-Wno-packed
-Wno-deprecated-declarations
-Os
SRCS