Skip to content

Commit

Permalink
Merge pull request #1501 from mavlink/pr-fix-armed
Browse files Browse the repository at this point in the history
Fix two warnings recently introduced
  • Loading branch information
julianoes committed Aug 5, 2021
2 parents 38033e7 + 0178ded commit 3204b40
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/mavsdk_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ void MavsdkImpl::set_base_mode(uint8_t base_mode)
_base_mode = base_mode;
}

bool MavsdkImpl::get_base_mode() const
uint8_t MavsdkImpl::get_base_mode() const
{
return _base_mode;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/mavsdk_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class MavsdkImpl {
MAVLinkAddress own_address{};

void set_base_mode(uint8_t base_mode);
bool get_base_mode() const;
uint8_t get_base_mode() const;
void set_custom_mode(uint32_t custom_mode);
uint32_t get_custom_mode() const;

Expand Down
2 changes: 1 addition & 1 deletion src/core/system_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ void SystemImpl::set_server_armed(bool armed)

bool SystemImpl::is_server_armed() const
{
return _parent.get_base_mode() & (MAV_MODE_FLAG_SAFETY_ARMED == MAV_MODE_FLAG_SAFETY_ARMED);
return (_parent.get_base_mode() & MAV_MODE_FLAG_SAFETY_ARMED) == MAV_MODE_FLAG_SAFETY_ARMED;
}

void SystemImpl::set_custom_mode(uint32_t custom_mode)
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/mission_raw_server/mission_raw_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void MissionRawServerImpl::set_current_item_complete()
_parent->get_own_system_id(),
_parent->get_own_component_id(),
&mission_reached,
_current_seq);
static_cast<uint16_t>(_current_seq));
_parent->send_message(mission_reached);
if (_current_seq + 1 == _current_mission.size()) {
_mission_completed = true;
Expand All @@ -320,7 +320,7 @@ void MissionRawServerImpl::set_current_item_complete()
}
}

void MissionRawServerImpl::set_current_seq(uint16_t seq)
void MissionRawServerImpl::set_current_seq(std::size_t seq)
{
if (_current_mission.size() <= static_cast<size_t>(seq)) {
return;
Expand All @@ -337,8 +337,8 @@ void MissionRawServerImpl::set_current_seq(uint16_t seq)
_parent->get_own_system_id(),
_parent->get_own_component_id(),
&mission_current,
_current_seq);
static_cast<uint16_t>(_current_seq));
_parent->send_message(mission_current);
}

} // namespace mavsdk
} // namespace mavsdk
6 changes: 3 additions & 3 deletions src/plugins/mission_raw_server/mission_raw_server_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MissionRawServerImpl : public PluginImplBase {
std::atomic<bool> _stop_work_thread = false;

std::vector<MAVLinkMissionTransfer::ItemInt> _current_mission;
uint16_t _current_seq;
std::size_t _current_seq;

struct MissionData {
mutable std::recursive_mutex mutex{};
Expand All @@ -66,7 +66,7 @@ class MissionRawServerImpl : public PluginImplBase {
MAVLinkMissionTransfer::Result result,
const std::vector<MAVLinkMissionTransfer::ItemInt>& int_items);

void set_current_seq(uint16_t seq);
void set_current_seq(std::size_t seq);

void add_task(std::function<void()> task)
{
Expand All @@ -82,4 +82,4 @@ class MissionRawServerImpl : public PluginImplBase {
bool _enable_absolute_gimbal_yaw_angle{true};
};

} // namespace mavsdk
} // namespace mavsdk

0 comments on commit 3204b40

Please sign in to comment.