Deprecate memset(3) for zero-init

This commit is contained in:
Xavier Del Campo Romero 2022-06-27 21:56:43 +02:00
parent a746ecd0b6
commit 6d5aa57e6d
2 changed files with 2 additions and 2 deletions

View File

@ -128,5 +128,5 @@ int terrain_render(const struct terrain_map *const map,
void terrain_init(struct terrain_map *const map)
{
memset(map, 0, sizeof *map);
*map = (const struct terrain_map){0};
}

View File

@ -133,7 +133,7 @@ static void unit_stop(struct unit *const u)
static void target_reset(struct unit *const u)
{
memset(&u->target, 0, sizeof u->target);
u->target = (const struct unit_target){0};
u->state = UNIT_STATE_IDLE_MOVING;
unit_stop(u);
}