17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-05 20:39:09 +01:00

refactor(sonar): document intentionally empty functions (cpp:S1186)

This commit is contained in:
jerrrrycho
2026-10-10 15:56:34 +02:00
parent 9aa7e658ac
commit 4b55445a53
10 changed files with 35 additions and 34 deletions

View File

@@ -296,6 +296,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
void TNESt3::EStParams( double const /*i_crc*/ ) const // parametry charakterystyczne dla ESt void TNESt3::EStParams( double const /*i_crc*/ ) const // parametry charakterystyczne dla ESt
{ {
// no effect for this device type
} }
void TNESt3::Init( double const PP, double const HPP, double const LPP, double const BP, int const BDF ) void TNESt3::Init( double const PP, double const HPP, double const LPP, double const BP, int const BDF )

View File

@@ -558,7 +558,7 @@ bool TBrake::Releaser() const
/// support the EP brake (TWest, TEStEP1/2, ...). /// support the EP brake (TWest, TEStEP1/2, ...).
/// </summary> /// </summary>
/// <param name="nEPS">EP intensity.</param> /// <param name="nEPS">EP intensity.</param>
void TBrake::SetEPS(double const nEPS) {} void TBrake::SetEPS(double const nEPS) { /* no effect for this device type */ }
/// <summary> /// <summary>
/// Sets the anti-slip brake state flags. Bit 1 of <paramref name="state"/> /// Sets the anti-slip brake state flags. Bit 1 of <paramref name="state"/>
@@ -1083,7 +1083,7 @@ void TESt::Init(double const PP, double const HPP, double const LPP, double cons
/// derived variants and currently a no-op. /// derived variants and currently a no-op.
/// </summary> /// </summary>
/// <param name="i_crc">Characteristic value.</param> /// <param name="i_crc">Characteristic value.</param>
void TESt::EStParams(double const /*i_crc*/) const {} void TESt::EStParams(double const /*i_crc*/) const { /* no effect for this device type */ }
/// <summary>Returns the control reservoir (ZS) pressure.</summary> /// <summary>Returns the control reservoir (ZS) pressure.</summary>
double TESt::GetCRP() double TESt::GetCRP()
@@ -2868,7 +2868,7 @@ void TDriverHandle::Init(double Press)
/// <summary>Default reductor adjustment — no-op.</summary> /// <summary>Default reductor adjustment — no-op.</summary>
/// <param name="nAdj">Pressure correction.</param> /// <param name="nAdj">Pressure correction.</param>
void TDriverHandle::SetReductor(double nAdj) {} void TDriverHandle::SetReductor(double nAdj) { /* no effect for this device type */ }
/// <summary>Default cab-gauge pressure — 0.</summary> /// <summary>Default cab-gauge pressure — 0.</summary>
double TDriverHandle::GetCP() double TDriverHandle::GetCP()

View File

@@ -442,7 +442,7 @@ class TBrake
virtual void SetEPS(double const nEPS); // hamulec EP virtual void SetEPS(double const nEPS); // hamulec EP
/// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary> /// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary>
/// <param name="RMR">Rapid ratio.</param> /// <param name="RMR">Rapid ratio.</param>
virtual void SetRM(double const RMR) {}; // ustalenie przelozenia rapida virtual void SetRM(double const RMR) { /* no effect for this device type */ } // ustalenie przelozenia rapida
/// <summary>Sets the velocity threshold for the rapid step.</summary> /// <summary>Sets the velocity threshold for the rapid step.</summary>
/// <param name="RVR">Velocity threshold (same unit as Vel passed to GetPF).</param> /// <param name="RVR">Velocity threshold (same unit as Vel passed to GetPF).</param>
virtual void SetRV(double const RVR) virtual void SetRV(double const RVR)
@@ -456,13 +456,13 @@ class TBrake
/// <param name="TM">Tare (empty) mass.</param> /// <param name="TM">Tare (empty) mass.</param>
/// <param name="LM">Loaded mass.</param> /// <param name="LM">Loaded mass.</param>
/// <param name="TBP">Brake cylinder pressure for the tare mass.</param> /// <param name="TBP">Brake cylinder pressure for the tare mass.</param>
virtual void SetLP(double const TM, double const LM, double const TBP) {}; // parametry przystawki wazacej virtual void SetLP(double const TM, double const LM, double const TBP) { /* no effect for this device type */ } // parametry przystawki wazacej
/// <summary>Sets the auxiliary (local) brake target pressure.</summary> /// <summary>Sets the auxiliary (local) brake target pressure.</summary>
/// <param name="P">Local brake pressure [bar].</param> /// <param name="P">Local brake pressure [bar].</param>
virtual void SetLBP(double const P) {}; // cisnienie z hamulca pomocniczego virtual void SetLBP(double const P) { /* no effect for this device type */ } // cisnienie z hamulca pomocniczego
/// <summary>Updates the load-weighing pressure coefficient based on current vehicle mass.</summary> /// <summary>Updates the load-weighing pressure coefficient based on current vehicle mass.</summary>
/// <param name="mass">Current vehicle mass.</param> /// <param name="mass">Current vehicle mass.</param>
virtual void PLC(double const mass) {}; // wspolczynnik cisnienia przystawki wazacej virtual void PLC(double const mass) { /* no effect for this device type */ } // wspolczynnik cisnienia przystawki wazacej
/// <summary> /// <summary>
/// Engages the anti-slip brake function (set hold and/or release flags). /// Engages the anti-slip brake function (set hold and/or release flags).
/// </summary> /// </summary>
@@ -498,7 +498,7 @@ class TBrake
/// brake when ED braking is sufficient. Default no-op; overridden where supported. /// brake when ED braking is sufficient. Default no-op; overridden where supported.
/// </summary> /// </summary>
/// <param name="EDstate">ED brake intensity (0..1).</param> /// <param name="EDstate">ED brake intensity (0..1).</param>
virtual void SetED(double const EDstate) {}; // stan hamulca ED do luzowania virtual void SetED(double const EDstate) { /* no effect for this device type */ } // stan hamulca ED do luzowania
/// <summary>Sets the universal-button flags (see TUniversalBrake).</summary> /// <summary>Sets the universal-button flags (see TUniversalBrake).</summary>
/// <param name="flag">Combined ub_* flags.</param> /// <param name="flag">Combined ub_* flags.</param>
virtual void SetUniversalFlag(int flag) virtual void SetUniversalFlag(int flag)
@@ -1076,7 +1076,7 @@ class TDriverHandle
/// <param name="OverP">Unbrake over-pressure [bar].</param> /// <param name="OverP">Unbrake over-pressure [bar].</param>
/// <param name="OMP">Overload (assimilation) max pressure [bar].</param> /// <param name="OMP">Overload (assimilation) max pressure [bar].</param>
/// <param name="OPD">Overload pressure decay rate [bar/s].</param> /// <param name="OPD">Overload pressure decay rate [bar/s].</param>
virtual void SetParams(bool AO, bool MO, double, double, double OMP, double OPD) {}; // ustawianie jakichs parametrow dla zaworu virtual void SetParams(bool AO, bool MO, double, double, double OMP, double OPD) { /* no effect for this device type */ } // ustawianie jakichs parametrow dla zaworu
/// <summary>Sets the manual overcharge button state.</summary> /// <summary>Sets the manual overcharge button state.</summary>
/// <param name="Active">True while the button is pressed.</param> /// <param name="Active">True while the button is pressed.</param>
virtual void OvrldButton(bool Active); // przycisk recznego przeladowania/asymilacji virtual void OvrldButton(bool Active); // przycisk recznego przeladowania/asymilacji

View File

@@ -21,7 +21,7 @@ struct IMaterial
{ {
static struct NullMaterial : public IMaterial static struct NullMaterial : public IMaterial
{ {
void finalize(bool Loadnow) override {} void finalize(bool Loadnow) override { /* null implementation, nothing to do */ }
bool update() override bool update() override
{ {
return false; return false;

View File

@@ -45,8 +45,8 @@ struct ITexture
{ {
return 0; return 0;
} }
void release() override {} void release() override { /* null implementation, nothing to do */ }
void make_stub() override {} void make_stub() override { /* null implementation, nothing to do */ }
std::string_view get_traits() const override std::string_view get_traits() const override
{ {
return ""; return "";
@@ -67,9 +67,9 @@ struct ITexture
{ {
return false; return false;
} }
void set_components_hint(int hint) override {} void set_components_hint(int hint) override { /* null implementation, nothing to do */ }
void make_from_memory(size_t width, size_t height, const uint8_t *data) override {} void make_from_memory(size_t width, size_t height, const uint8_t *data) override { /* null implementation, nothing to do */ }
void update_from_memory(size_t width, size_t height, const uint8_t *data) override {} void update_from_memory(size_t width, size_t height, const uint8_t *data) override { /* null implementation, nothing to do */ }
} null_texture{}; } null_texture{};
return &null_texture; return &null_texture;
} }

View File

@@ -29,7 +29,7 @@ void launcher_mode::enter()
void launcher_mode::exit() void launcher_mode::exit()
{ {
// nothing to do
} }
void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods) void launcher_mode::on_key(const int Key, const int Scancode, const int Action, const int Mods)

View File

@@ -19,8 +19,8 @@ struct message
type_e type; type_e type;
message(type_e t) : type(t) {} message(type_e t) : type(t) {}
virtual void serialize(std::ostream &stream) const {} virtual void serialize(std::ostream &stream) const { /* message carries no payload */ }
virtual void deserialize(std::istream &stream) {} virtual void deserialize(std::istream &stream) { /* message carries no payload */ }
virtual ~message() = default; virtual ~message() = default;
}; };

View File

@@ -23,16 +23,16 @@ private:
// methods: // methods:
// create() subclass details // create() subclass details
void void
create_( gfx::geometry_handle const &Geometry ) override {} create_( gfx::geometry_handle const &Geometry ) override { /* null implementation, nothing to do */ }
// replace() subclass details // replace() subclass details
void void
replace_( gfx::geometry_handle const &Geometry ) override {} replace_( gfx::geometry_handle const &Geometry ) override { /* null implementation, nothing to do */ }
// draw() subclass details // draw() subclass details
auto auto
draw_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, unsigned int const Streams ) -> std::size_t override { return 0; } draw_( gfx::geometry_handle const &Geometry, gfx::stream_units const &Units, unsigned int const Streams ) -> std::size_t override { return 0; }
// release() subclass details // release() subclass details
void void
release_() override {} release_() override { /* null implementation, nothing to do */ }
}; };
// bare-bones render controller, in lack of anything better yet // bare-bones render controller, in lack of anything better yet
@@ -51,14 +51,14 @@ public:
bool bool
Render() override { return true; } Render() override { return true; }
void void
SwapBuffers() override {} SwapBuffers() override { /* null implementation, nothing to do */ }
inline inline
float float
Framerate() override { return 10.0f; } Framerate() override { return 10.0f; }
bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; } bool AddViewport(const global_settings::extraviewport_config &conf) override { return false; }
bool Debug_Ui_State(std::optional<bool>) override { return false; } bool Debug_Ui_State(std::optional<bool>) override { return false; }
void Shutdown() override {} void Shutdown() override { /* null implementation, nothing to do */ }
// geometry methods // geometry methods
// NOTE: hands-on geometry management is exposed as a temporary measure; ultimately all visualization data should be generated/handled automatically by the renderer itself // NOTE: hands-on geometry management is exposed as a temporary measure; ultimately all visualization data should be generated/handled automatically by the renderer itself
@@ -103,7 +103,7 @@ public:
return static_cast<material_handle>(m_materials.size()); return static_cast<material_handle>(m_materials.size());
} }
void void
Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override {} Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) override { /* null implementation, nothing to do */ }
IMaterial const * IMaterial const *
Material( material_handle const Material ) const override { return m_materials.at(Material - 1).get(); } Material( material_handle const Material ) const override { return m_materials.at(Material - 1).get(); }
// shader methods // shader methods
@@ -112,18 +112,18 @@ public:
texture_handle texture_handle
Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override { throw std::runtime_error("not impl"); } Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) override { throw std::runtime_error("not impl"); }
void void
Bind_Texture( texture_handle const Texture ) override {} Bind_Texture( texture_handle const Texture ) override { /* null implementation, nothing to do */ }
void void
Bind_Texture( std::size_t const Unit, texture_handle const Texture ) override {} Bind_Texture( std::size_t const Unit, texture_handle const Texture ) override { /* null implementation, nothing to do */ }
opengl_texture & opengl_texture &
Texture( texture_handle const Texture ) override { throw std::runtime_error("not impl"); } Texture( texture_handle const Texture ) override { throw std::runtime_error("not impl"); }
opengl_texture const & opengl_texture const &
Texture( texture_handle const Texture ) const override { throw std::runtime_error("not impl"); } Texture( texture_handle const Texture ) const override { throw std::runtime_error("not impl"); }
// utility methods // utility methods
void void
Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) override {} Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) override { /* null implementation, nothing to do */ }
void void
Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override {} Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) override { /* null implementation, nothing to do */ }
TSubModel const * TSubModel const *
Pick_Control() const override { return nullptr; } Pick_Control() const override { return nullptr; }
scene::basic_node const * scene::basic_node const *
@@ -132,11 +132,11 @@ public:
Mouse_Position() const override { return glm::dvec3(); } Mouse_Position() const override { return glm::dvec3(); }
// maintenance methods // maintenance methods
void void
Update( double const Deltatime ) override {} Update( double const Deltatime ) override { /* null implementation, nothing to do */ }
void void
Update_Pick_Control() override {} Update_Pick_Control() override { /* null implementation, nothing to do */ }
void void
Update_Pick_Node() override {} Update_Pick_Node() override { /* null implementation, nothing to do */ }
glm::dvec3 glm::dvec3
Update_Mouse_Position() override { return glm::dvec3(); } Update_Mouse_Position() override { return glm::dvec3(); }
// debug methods // debug methods
@@ -144,7 +144,7 @@ public:
info_times() const override { return empty_str; } info_times() const override { return empty_str; }
std::string const & std::string const &
info_stats() const override { return empty_str; } info_stats() const override { return empty_str; }
void MakeScreenshot() override {} void MakeScreenshot() override { /* null implementation, nothing to do */ }
static std::unique_ptr<gfx_renderer> create_func(); static std::unique_ptr<gfx_renderer> create_func();

View File

@@ -16,7 +16,7 @@ void opengl33_light::apply_intensity(float const Factor) {
factor = Factor; factor = Factor;
} }
void opengl33_light::apply_angle() const {} void opengl33_light::apply_angle() const { /* nothing to do */ }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -232,7 +232,7 @@ void render_task::upload() const
} }
} }
void render_task::cancel() const {} void render_task::cancel() const { /* nothing to do */ }
// initializes the module. returns true on success // initializes the module. returns true on success
auto python_taskqueue::init() -> bool auto python_taskqueue::init() -> bool