From 64a1f3b2eab0a8cc5356c51c65a09ca4db836bd3 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 17 Jun 2021 22:14:20 -0400
Subject: [PATCH] Use SDL_arraysize() instead of the more-verbose sizeof
tapdance.
---
src/SDL12_compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index da5e61d..939fe3f 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -1563,7 +1563,7 @@ Init12VidModes(void)
/* Attempt to add all of the fake modes. */
if (use_fake_modes) {
- for (j = 0; j < sizeof(fake_modes) / sizeof(fake_modes[0]); ++j) {
+ for (j = 0; j < SDL_arraysize(fake_modes); ++j) {
if (VidModeSizeGreater(&prev_mode, &fake_modes[j]) && VidModeSizeGreater(&fake_modes[j], ¤t_mode)) {
if (AddVidModeToList(vmode, &fake_modes[j])) {
return SDL20_OutOfMemory();
@@ -1582,7 +1582,7 @@ Init12VidModes(void)
/* we need to try to add fake modes to the end of the list once there are no more real modes */
if (use_fake_modes) {
- for (i = 0; i < sizeof(fake_modes) / sizeof(fake_modes[0]); ++i) {
+ for (i = 0; i < SDL_arraysize(fake_modes); ++i) {
if (VidModeSizeGreater(&prev_mode, &fake_modes[i])) {
if (AddVidModeToList(vmode, &fake_modes[i])) {
return SDL20_OutOfMemory();