Deprecate memset(3) for zero-init
This commit is contained in:
parent
a746ecd0b6
commit
6d5aa57e6d
|
@ -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};
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue