Change "memset" to "SDL_zero"

This commit is contained in:
Cacodemon345 2021-02-14 14:24:38 +06:00 committed by Ryan C. Gordon
parent c5f9e061b5
commit cf15faae68

View File

@ -93,6 +93,7 @@ static void kbd_cleanup(void)
return; return;
} }
kbd_cleanup_state = NULL; kbd_cleanup_state = NULL;
SDL_zero(mData);
mData.operation = MOUSE_SHOW; mData.operation = MOUSE_SHOW;
ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode); ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode);
if (kbd->keyboard_fd != kbd->console_fd) close(kbd->keyboard_fd); if (kbd->keyboard_fd != kbd->console_fd) close(kbd->keyboard_fd);
@ -227,7 +228,7 @@ SDL_EVDEV_kbd_init(void)
char flag_state; char flag_state;
char* devicePath; char* devicePath;
memset(&mData, 0, sizeof(struct mouse_info)); SDL_zero(mData);
mData.operation = MOUSE_HIDE; mData.operation = MOUSE_HIDE;
kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(SDL_EVDEV_keyboard_state)); kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(SDL_EVDEV_keyboard_state));
if (!kbd) { if (!kbd) {
@ -303,7 +304,7 @@ SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd)
if (!kbd) { if (!kbd) {
return; return;
} }
memset(&mData, 0, sizeof(struct mouse_data)); SDL_zero(mData);
mData.operation = MOUSE_SHOW; mData.operation = MOUSE_SHOW;
ioctl(kbd->console_fd, CONS_MOUSECTL, &mData); ioctl(kbd->console_fd, CONS_MOUSECTL, &mData);