18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 17:54:58 +01:00

refactor(sonar): make narrowing conversions explicit (cpp:S5276)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 15:16:28 +02:00
parent 80464d0bc1
commit 8c23c1fe2b
53 changed files with 468 additions and 468 deletions

View File

@@ -59,10 +59,10 @@ RGBtoHSV( glm::vec3 const &RGB ) {
else
hsv.x = 4.f + ( RGB.r - RGB.g ) / delta; // between magenta & cyan
hsv.x *= 60.0; // degrees
hsv.x *= 60.0f; // degrees
if( hsv.x < 0.0 )
hsv.x += 360.0;
hsv.x += 360.0f;
return hsv;
}
@@ -81,9 +81,9 @@ HSVtoRGB( glm::vec3 const &HSV ) {
}
float hh = HSV.x;
if( hh >= 360.0 ) hh = 0.0;
hh /= 60.0;
hh /= 60.0f;
int const i = (int)hh;
float const ff = hh - i;
float const ff = hh - static_cast<float>(i);
float const p = HSV.z * ( 1.f - HSV.y );
float const q = HSV.z * ( 1.f - HSV.y * ff );
float const t = HSV.z * ( 1.f - HSV.y * (1.f - ff) );