AP_Mission: Add missing const in member functions

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2021-02-01 13:26:31 -03:00 committed by Andrew Tridgell
parent 5d7d955378
commit 266ed9541b
2 changed files with 4 additions and 4 deletions

View File

@ -532,7 +532,7 @@ bool AP_Mission::set_item(uint16_t index, mavlink_mission_item_int_t& src_packet
return AP_Mission::replace_cmd( index, cmd); return AP_Mission::replace_cmd( index, cmd);
} }
bool AP_Mission::get_item(uint16_t index, mavlink_mission_item_int_t& ret_packet) bool AP_Mission::get_item(uint16_t index, mavlink_mission_item_int_t& ret_packet) const
{ {
// setting ret_packet.command = -1 and/or returning false // setting ret_packet.command = -1 and/or returning false
// means it contains invalid data after it leaves here. // means it contains invalid data after it leaves here.
@ -1915,7 +1915,7 @@ uint16_t AP_Mission::num_commands_max(void) const
// find the nearest landing sequence starting point (DO_LAND_START) and // find the nearest landing sequence starting point (DO_LAND_START) and
// return its index. Returns 0 if no appropriate DO_LAND_START point can // return its index. Returns 0 if no appropriate DO_LAND_START point can
// be found. // be found.
uint16_t AP_Mission::get_landing_sequence_start() uint16_t AP_Mission::get_landing_sequence_start() const
{ {
struct Location current_loc; struct Location current_loc;

View File

@ -510,7 +510,7 @@ public:
// find the nearest landing sequence starting point (DO_LAND_START) and // find the nearest landing sequence starting point (DO_LAND_START) and
// return its index. Returns 0 if no appropriate DO_LAND_START point can // return its index. Returns 0 if no appropriate DO_LAND_START point can
// be found. // be found.
uint16_t get_landing_sequence_start(); uint16_t get_landing_sequence_start() const;
// find the nearest landing sequence starting point (DO_LAND_START) and // find the nearest landing sequence starting point (DO_LAND_START) and
// switch to that mission item. Returns false if no DO_LAND_START // switch to that mission item. Returns false if no DO_LAND_START
@ -566,7 +566,7 @@ public:
static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Param::GroupInfo var_info[];
// allow lua to get/set any WP items in any order in a mavlink-ish kinda way. // allow lua to get/set any WP items in any order in a mavlink-ish kinda way.
bool get_item(uint16_t index, mavlink_mission_item_int_t& result) ; bool get_item(uint16_t index, mavlink_mission_item_int_t& result) const ;
bool set_item(uint16_t index, mavlink_mission_item_int_t& source) ; bool set_item(uint16_t index, mavlink_mission_item_int_t& source) ;
private: private: