Cleanup warnings in examples (#5467)

This commit is contained in:
Jeffery Myers
2026-01-03 13:38:51 -08:00
committed by GitHub
parent f67e70bb47
commit b00cbdaf49
13 changed files with 83 additions and 80 deletions

View File

@ -46,12 +46,12 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - ball physics");
Ball balls[MAX_BALLS] = {{
.pos = { GetScreenWidth()/2, GetScreenHeight()/2 },
.pos = { GetScreenWidth()/2.0f, GetScreenHeight()/2.0f },
.vel = { 200, 200 },
.ppos = { 0 },
.radius = 40,
.friction = 0.99,
.elasticity = 0.9,
.friction = 0.99f,
.elasticity = 0.9f,
.color = BLUE,
.grabbed = false
}};
@ -110,11 +110,11 @@ int main(void)
{
balls[ballCount++] = (Ball){
.pos = mousePos,
.vel = { GetRandomValue(-300, 300), GetRandomValue(-300, 300) },
.vel = { (float)GetRandomValue(-300, 300), (float)GetRandomValue(-300, 300) },
.ppos = { 0 },
.radius = 20 + GetRandomValue(0, 30),
.friction = 0.99,
.elasticity = 0.9,
.radius = 20.0f + (float)GetRandomValue(0, 30),
.friction = 0.99f,
.elasticity = 0.9f,
.color = { GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 },
.grabbed = false
};
@ -126,7 +126,7 @@ int main(void)
{
for (int i = 0; i < ballCount; i++)
{
if (!balls[i].grabbed) balls[i].vel = (Vector2){ GetRandomValue(-2000, 2000), GetRandomValue(-2000, 2000) };
if (!balls[i].grabbed) balls[i].vel = (Vector2){ (float)GetRandomValue(-2000, 2000), (float)GetRandomValue(-2000, 2000) };
}
}