use SDL stdlib where possible
This commit is contained in:
@ -108,7 +108,7 @@ static void input_bind_code_to_action(InputState *input,
|
||||
if (action->num_bindings == SDL_arraysize(action->bindings)) {
|
||||
--action->num_bindings;
|
||||
size_t shifted_size = (sizeof action->bindings) - (sizeof action->bindings[0]);
|
||||
memmove(action->bindings, action->bindings + 1, shifted_size);
|
||||
SDL_memmove(action->bindings, action->bindings + 1, shifted_size);
|
||||
}
|
||||
|
||||
action->bindings[action->num_bindings++] = (Button) {
|
||||
@ -169,7 +169,7 @@ static void input_unbind_code_from_action(InputState *input,
|
||||
/* remove the element to unbind and shift the rest so there isn't a gap */
|
||||
size_t elements_after_index = action->num_bindings - index;
|
||||
size_t shifted_size = elements_after_index * sizeof action->bindings[0];
|
||||
memmove(action->bindings + index, action->bindings + index + 1, shifted_size);
|
||||
SDL_memmove(action->bindings + index, action->bindings + index + 1, shifted_size);
|
||||
--action->num_bindings;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user