Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two warnings recently introduced #1501

Merged
merged 2 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
bazfp marked this conversation as resolved.
Show resolved Hide resolved
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