From 32b6de729d81f09fb3cc9a7e225d93b126b098b0 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 9 Sep 2020 21:48:45 -0700 Subject: [PATCH] Use SDL_arraysize() instead of writing out array length Using the macro makes it less likely that there will be a mistake when writing out the array length. --- desktop_version/src/Script.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Script.h b/desktop_version/src/Script.h index 7af1c8e8..e4d07b13 100644 --- a/desktop_version/src/Script.h +++ b/desktop_version/src/Script.h @@ -4,7 +4,9 @@ #include #include -#define filllines(lines) commands.insert(commands.end(), lines, lines + sizeof(lines)/sizeof(lines[0])) +#include + +#define filllines(lines) commands.insert(commands.end(), lines, lines + SDL_arraysize(lines)) struct Script