17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 00:02:26 +01:00

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

Virtual functions are left untouched so overrides keep matching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 15:26:48 +02:00
parent 1f256e9593
commit 3198cabc78
82 changed files with 221 additions and 221 deletions

View File

@@ -25,7 +25,7 @@ void float4x4::deserialize_float64(std::istream &s)
e[i] = (float)sn_utils::ld_float64(s);
}
void float4x4::serialize_float32(std::ostream &s)
void float4x4::serialize_float32(std::ostream &s) const
{
for (size_t i = 0; i < 16; i++)
sn_utils::ls_float32(s, e[i]);

View File

@@ -217,7 +217,7 @@ public:
void deserialize_float32(std::istream&);
void deserialize_float64(std::istream&);
void serialize_float32(std::ostream&);
void serialize_float32(std::ostream&) const;
float4x4() = default;
float4x4(const float f[16])
{
@@ -254,7 +254,7 @@ public:
}
};
inline float4x4 &Rotation(float const angle, float3 const &axis);
inline bool IdentityIs()
inline bool IdentityIs() const
{ // sprawdzenie jednostkowości
for (int i = 0; i < 16; ++i)
if (e[i] != (i % 5 ? 0.0 : 1.0)) // jedynki tylko na 0, 5, 10 i 15

View File

@@ -19,7 +19,7 @@ void headtrack::find_joy() {
joy_id = -1;
}
float headtrack::get_axis(const float *data, int count, int axis, float mul) {
float headtrack::get_axis(const float *data, int count, int axis, float mul) const {
if (axis < 0)
return 0.0f;
if (axis >= count)

View File

@@ -5,7 +5,7 @@ class headtrack
int joy_id = -1;
void find_joy();
float get_axis(const float *data, int count, int axis, float mul);
float get_axis(const float *data, int count, int axis, float mul) const;
public:
headtrack();