From 523a4aa7851d364b9bbd3f008221bed5898f53c4 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Tue, 28 Apr 2015 12:29:50 -0700 Subject: [PATCH] Clang warning fix Clang build fails due to -Werr and warning on use of if (!condition != other_condition && some_condition) Clang wants to be clear that the initial '!' wasn't intended for the whole expression. Signed-off-by: Mark Charlebois --- src/modules/commander/commander.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 73411bb1c3..e4644c03a3 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -546,7 +547,7 @@ bool handle_command(struct vehicle_status_s *status_local, const struct safety_s else { // Refuse to arm if preflight checks have failed - if (!status.hil_state != vehicle_status_s::HIL_STATE_ON && !status.condition_system_sensors_initialized) { + if ((!status.hil_state) != vehicle_status_s::HIL_STATE_ON && !status.condition_system_sensors_initialized) { mavlink_log_critical(mavlink_fd, "Arming DENIED. Preflight checks have failed."); cmd_result = VEHICLE_CMD_RESULT_DENIED; break;