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

refactor(sonar): remove empty statements, one declaration per statement (cpp:S1116, cpp:S1659)

This commit is contained in:
jerrrrycho
2026-10-10 15:03:30 +02:00
parent 3d46090e49
commit c4738dbc87
35 changed files with 315 additions and 180 deletions

View File

@@ -33,9 +33,15 @@ void float4x4::serialize_float32(std::ostream &s)
void float4x4::Quaternion(float4 *q)
{ // konwersja kwaternionu obrotu na macierz obrotu
float xx = q->x * q->x, yy = q->y * q->y, zz = q->z * q->z;
float xy = q->x * q->y, xz = q->x * q->z, yz = q->y * q->z;
float wx = q->w * q->x, wy = q->w * q->y, wz = q->w * q->z;
float xx = q->x * q->x;
float yy = q->y * q->y;
float zz = q->z * q->z;
float xy = q->x * q->y;
float xz = q->x * q->z;
float yz = q->y * q->z;
float wx = q->w * q->x;
float wy = q->w * q->y;
float wz = q->w * q->z;
e[0] = 1.0f - yy - yy - zz - zz;
e[1] = xy + xy + wz + wz;
e[2] = xz + xz - wy - wy;

View File

@@ -15,7 +15,9 @@ http://mozilla.org/MPL/2.0/.
class float3
{ // wapółrzędne wierchołka 3D o pojedynczej precyzji
public:
float x, y, z;
float x;
float y;
float z;
float3(void){};
float3(float a, float b, float c)
{
@@ -96,7 +98,10 @@ inline float3 Interpolate( float3 const &First, float3 const &Second, float cons
class float4
{ // kwaternion obrotu
public:
float x, y, z, w;
float x;
float y;
float z;
float w;
float4()
{
x = y = z = 0.f;
@@ -177,7 +182,8 @@ inline float4 Slerp(const float4 &q0, const float4 &q1, float t)
new_q1.w = -new_q1.w;
cosOmega = -cosOmega;
}
float k0, k1;
float k0;
float k1;
if (cosOmega > 0.9999f)
{ // jeśli jesteśmy z (t) na maksimum kosinusa, to tam prawie liniowo jest
k0 = 1.0f - t;
@@ -200,7 +206,8 @@ struct float8
public:
float3 Point;
float3 Normal;
float tu, tv;
float tu;
float tv;
};
class float4x4
@@ -345,10 +352,22 @@ inline float Det3x3(float a1, float a2, float a3, float b1, float b2, float b3,
inline
float Det(const float4x4 &m)
{ // obliczenie wyznacznika macierzy 4×4
float a1 = m[0][0], a2 = m[1][0], a3 = m[2][0], a4 = m[3][0];
float b1 = m[0][1], b2 = m[1][1], b3 = m[2][1], b4 = m[3][1];
float c1 = m[0][2], c2 = m[1][2], c3 = m[2][2], c4 = m[3][2];
float d1 = m[0][3], d2 = m[1][3], d3 = m[2][3], d4 = m[3][3];
float a1 = m[0][0];
float a2 = m[1][0];
float a3 = m[2][0];
float a4 = m[3][0];
float b1 = m[0][1];
float b2 = m[1][1];
float b3 = m[2][1];
float b4 = m[3][1];
float c1 = m[0][2];
float c2 = m[1][2];
float c3 = m[2][2];
float c4 = m[3][2];
float d1 = m[0][3];
float d2 = m[1][3];
float d3 = m[2][3];
float d4 = m[3][3];
return +a1 * Det3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4) -
b1 * Det3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4) +
c1 * Det3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4) -

View File

@@ -16,7 +16,8 @@ namespace Timer {
subsystem_stopwatches subsystem;
double DeltaTime = 0.0, DeltaRenderTime = 0.0;
double DeltaTime = 0.0;
double DeltaRenderTime = 0.0;
double fFPS{ 0.0f };
double fLastTime{ 0.0f };
DWORD dwFrames{ 0 };
@@ -59,7 +60,9 @@ void ResetTimers()
DeltaRenderTime = 0.0;
}
uint64_t fr, count, oldCount;
uint64_t fr;
uint64_t count;
uint64_t oldCount;
void UpdateTimers(bool pause)
{

View File

@@ -28,7 +28,8 @@ motiontelemetry::motiontelemetry()
throw std::runtime_error("failed to init winsock");
#endif
struct addrinfo hints, *res;
struct addrinfo hints;
struct addrinfo *res;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;