mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-03 06:40:15 +02:00
Prefer SDL_arraysize()
Replace uses of (sizeof(arr)/sizeof(arr[0]), and similar, with the SDL_arraysize() macro.
This commit is contained in:
committed by
Sam Lantinga
parent
d33642b710
commit
3d354eeaad
@@ -224,7 +224,7 @@ static void kbd_unregister_emerg_cleanup(void)
|
||||
}
|
||||
kbd_cleanup_sigactions_installed = 0;
|
||||
|
||||
for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) {
|
||||
for (tabidx = 0; tabidx < SDL_arraysize(fatal_signals); ++tabidx) {
|
||||
struct sigaction *old_action_p;
|
||||
struct sigaction cur_action;
|
||||
int signum = fatal_signals[tabidx];
|
||||
@@ -277,7 +277,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd)
|
||||
}
|
||||
kbd_cleanup_sigactions_installed = 1;
|
||||
|
||||
for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) {
|
||||
for (tabidx = 0; tabidx < SDL_arraysize(fatal_signals); ++tabidx) {
|
||||
struct sigaction *old_action_p;
|
||||
struct sigaction new_action;
|
||||
int signum = fatal_signals[tabidx];
|
||||
|
||||
Reference in New Issue
Block a user