From 3c80ea20c7a2ac4d38aa7ce457571224fd4bbdfa Mon Sep 17 00:00:00 2001 From: jerrrrycho Date: Sat, 10 Oct 2026 16:29:47 +0200 Subject: [PATCH] refactor(sonar): drop top-level const from by-value return types (cpp:S5951) --- McZapkie/MOVER.h | 2 +- audio/sound.cpp | 4 ++-- audio/sound.h | 4 ++-- gl/object.h | 4 ++-- input/keyboardinput.h | 2 +- scripting/ladderlogic.h | 2 +- vehicle/Train.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/McZapkie/MOVER.h b/McZapkie/MOVER.h index 0d220464..4cc866b4 100644 --- a/McZapkie/MOVER.h +++ b/McZapkie/MOVER.h @@ -1240,7 +1240,7 @@ struct TCoupling { return adapter_type != TCouplerType::NoCoupler; } - inline TCouplerType const type() const + inline TCouplerType type() const { return adapter_type == TCouplerType::NoCoupler ? CouplerType : adapter_type; } diff --git a/audio/sound.cpp b/audio/sound.cpp index b0935197..7eba59d6 100644 --- a/audio/sound.cpp +++ b/audio/sound.cpp @@ -898,7 +898,7 @@ sound_source::has_bookends() const { } // returns location of the sound source in simulation region space -glm::dvec3 const +glm::dvec3 sound_source::location() const { if( m_owner == nullptr ) { @@ -920,7 +920,7 @@ sound_source::range( float const Range ) { } // returns defined range of the sound -float const +float sound_source::range() const { return m_range; diff --git a/audio/sound.h b/audio/sound.h index c0f14513..c1f11876 100644 --- a/audio/sound.h +++ b/audio/sound.h @@ -137,12 +137,12 @@ public: bool has_bookends() const; // returns location of the sound source in simulation region space - glm::dvec3 const + glm::dvec3 location() const; // returns defined range of the sound void range( float const Range ); - float const + float range() const; // members diff --git a/gl/object.h b/gl/object.h index eb200889..7bb95463 100644 --- a/gl/object.h +++ b/gl/object.h @@ -15,12 +15,12 @@ namespace gl return id; } - inline operator GLuint* const() + inline operator GLuint*() { return &id; } - inline operator const GLuint* const() const + inline operator const GLuint*() const { return &id; } diff --git a/input/keyboardinput.h b/input/keyboardinput.h index 832d5eef..1611c9a3 100644 --- a/input/keyboardinput.h +++ b/input/keyboardinput.h @@ -56,7 +56,7 @@ public: void poll(); inline - user_command const + user_command command() const { return m_command; } bindingsetup_sequence& diff --git a/scripting/ladderlogic.h b/scripting/ladderlogic.h index 3d430f62..0d064508 100644 --- a/scripting/ladderlogic.h +++ b/scripting/ladderlogic.h @@ -110,7 +110,7 @@ private: return Value == 0 ? 1 : 0; } // element access inline - auto element( element_handle const Element ) const -> basic_element const { + auto element( element_handle const Element ) const -> basic_element { return m_elements[ Element - 1 ]; } inline auto element( element_handle const Element ) -> basic_element & { diff --git a/vehicle/Train.h b/vehicle/Train.h index 18a45f4d..3d762a81 100644 --- a/vehicle/Train.h +++ b/vehicle/Train.h @@ -929,7 +929,7 @@ private: // plays provided sound from position of the radio bool radio_message_played; void radio_message( sound_source *Message, int const Channel ); - inline auto const RadioChannel() const { return Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1; } + inline auto RadioChannel() const { return Dynamic()->Mechanik ? Dynamic()->Mechanik->iRadioChannel : 1; } inline auto &RadioChannel() { return Dynamic()->Mechanik->iRadioChannel; } inline TDynamicObject *Dynamic() { return DynamicObject; }; inline TDynamicObject const *Dynamic() const { return DynamicObject; };