AP_OSD: 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:32 -03:00 committed by Andrew Tridgell
parent 3df3d002ff
commit a902c1d54b
3 changed files with 4 additions and 4 deletions

View File

@ -304,12 +304,12 @@ public:
// initialize the setting from the configured information // initialize the setting from the configured information
void update(); void update();
// grab the parameter name // grab the parameter name
void copy_name(char* name, size_t len) { void copy_name(char* name, size_t len) const {
_param->copy_name_token(_current_token, name, len); _param->copy_name_token(_current_token, name, len);
if (len > 16) name[16] = 0; if (len > 16) name[16] = 0;
} }
// copy the name converting FOO_BAR_BAZ to FooBarBaz // copy the name converting FOO_BAR_BAZ to FooBarBaz
void copy_name_camel_case(char* name, size_t len); void copy_name_camel_case(char* name, size_t len) const;
// set the ranges from static metadata // set the ranges from static metadata
bool set_from_metadata(); bool set_from_metadata();
bool set_by_name(const char* name, uint8_t config_type, float pmin=0, float pmax=0, float pincr=0); bool set_by_name(const char* name, uint8_t config_type, float pmin=0, float pmax=0, float pincr=0);

View File

@ -68,7 +68,7 @@ protected:
} }
//check option //check option
bool check_option(uint32_t option) bool check_option(uint32_t option) const
{ {
return (_osd.options & option) != 0; return (_osd.options & option) != 0;
} }

View File

@ -417,7 +417,7 @@ void AP_OSD_ParamSetting::guess_ranges(bool force)
} }
// copy the name converting FOO_BAR_BAZ to FooBarBaz // copy the name converting FOO_BAR_BAZ to FooBarBaz
void AP_OSD_ParamSetting::copy_name_camel_case(char* name, size_t len) void AP_OSD_ParamSetting::copy_name_camel_case(char* name, size_t len) const
{ {
char buf[17]; char buf[17];
_param->copy_name_token(_current_token, buf, 17); _param->copy_name_token(_current_token, buf, 17);