17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 15:30:28 +01:00

refactor(sonar): declare non-mutating member functions const (cpp:S5817)

Virtual functions are left untouched so overrides keep matching.
This commit is contained in:
jerrrrycho
2026-10-10 15:26:48 +02:00
parent 01d2b9bf82
commit 8042953b95
82 changed files with 221 additions and 221 deletions

View File

@@ -854,7 +854,7 @@ command_queue::pop( command_data &Command, uint32_t const Recipient ) {
return true;
}
bool command_queue::is_network_target(uint32_t const Recipient) {
bool command_queue::is_network_target(uint32_t const Recipient) const {
const command_target target = (command_target)(Recipient & ~0xffff);
if (target == command_target::entity)

View File

@@ -469,7 +469,7 @@ public:
update();
// checks if given command must be scheduled on server
bool
is_network_target(const uint32_t Recipient);
is_network_target(const uint32_t Recipient) const;
// pops commands from intercept queue
commands_map pop_intercept_queue();

View File

@@ -1116,7 +1116,7 @@ drivermouse_input::default_bindings() {
}
user_command
drivermouse_input::adjust_command( user_command Command ) {
drivermouse_input::adjust_command( user_command Command ) const {
if( true == Global.shiftState
&& Command != user_command::none ) {

View File

@@ -91,7 +91,7 @@ private:
default_bindings();
// potentially replaces supplied command with a more relevant one
user_command
adjust_command( user_command Command );
adjust_command( user_command Command ) const;
// members
command_relay m_relay;

View File

@@ -125,7 +125,7 @@ gamepad_input::poll() {
}
void
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) {
gamepad_input::bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const {
for( auto &bindingtarget : Targets ) {
// grab command(s) associated with the input pin

View File

@@ -77,7 +77,7 @@ private:
using inputaxis_sequence = std::vector<input_axis>;
// methods
bool recall_bindings();
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point );
void bind( std::vector< std::reference_wrapper<user_command> > &Targets, cParser &Input, std::unordered_map<std::string, user_command> const &Translator, std::string const Point ) const;
void on_button( int const Button, int const Action );
void process_axes();

View File

@@ -225,7 +225,7 @@ keyboard_input::recall_bindings() {
return true;
}
void keyboard_input::dump_bindings()
void keyboard_input::dump_bindings() const
{
std::fstream stream("eu07_input-keyboard.ini",
std::ios_base::binary | std::ios_base::trunc | std::ios_base::out);

View File

@@ -67,7 +67,7 @@ public:
std::string
binding_hint( user_command const Command ) const;
void
dump_bindings();
dump_bindings() const;
// members
static std::unordered_map<int, std::string> keytonamemap;