fix -Wextra

This commit is contained in:
Chu'vok
2024-09-18 12:44:26 +02:00
parent e8ea7dc5df
commit 9c26ab9668

View File

@@ -56,7 +56,7 @@ static void game(void) {
snek.state = crash ? OVER : snek.state; snek.state = crash ? OVER : snek.state;
// food // food
if (snek.food.xy == snek.body[0].xy) { if (snek.food.xy == snek.body[0].xy) {
snek.len = MIN(snek.len + 2, ARRAY_SIZE(snek.body)); snek.len = MIN(snek.len + 2, (int)ARRAY_SIZE(snek.body));
snek.food.x = rand() % (tim.w / 2 - 2) + 1; snek.food.x = rand() % (tim.w / 2 - 2) + 1;
snek.food.y = rand() % (tim.h - 2) + 1; snek.food.y = rand() % (tim.h - 2) + 1;
} }