[Scummvm-git-logs] scummvm master -> 4640c5c9cf9c5ce0c80fd064e12cfd3f30e9f17c

bluegr noreply at scummvm.org
Sun Feb 15 20:44:32 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
4640c5c9cf JANITORIAL: DEVTOOLS: use common ARRAYSIZE macro definition


Commit: 4640c5c9cf9c5ce0c80fd064e12cfd3f30e9f17c
    https://github.com/scummvm/scummvm/commit/4640c5c9cf9c5ce0c80fd064e12cfd3f30e9f17c
Author: Michael Kuerbis (michael_kuerbis at web.de)
Date: 2026-02-15T22:44:29+02:00

Commit Message:
JANITORIAL: DEVTOOLS: use common ARRAYSIZE macro definition

Changed paths:
    devtools/create_drascula/create_drascula.cpp
    devtools/create_drascula/create_drascula.h
    devtools/create_project/create_project.cpp
    devtools/create_tony/create_tony.h
    devtools/create_toon/create_toon.h
    devtools/qtable/qtable.cpp


diff --git a/devtools/create_drascula/create_drascula.cpp b/devtools/create_drascula/create_drascula.cpp
index 17593a991d6..5603595dc75 100644
--- a/devtools/create_drascula/create_drascula.cpp
+++ b/devtools/create_drascula/create_drascula.cpp
@@ -28,6 +28,11 @@
 #include "create_drascula.h"
 #include "staticdata.h"
 
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/util.h"
+
+
 #define DRASCULA_DAT_VER 7	// 1 byte
 
 static void writeByte(FILE *fp, uint8 b) {
diff --git a/devtools/create_drascula/create_drascula.h b/devtools/create_drascula/create_drascula.h
index 26ba07a75f2..df7ccf0eefc 100644
--- a/devtools/create_drascula/create_drascula.h
+++ b/devtools/create_drascula/create_drascula.h
@@ -22,8 +22,6 @@
 #ifndef CREATE_DRASCULA_H
 #define CREATE_DRASCULA_H
 
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-
 #define DATAALIGNMENT 4
 
 #define NUM_LANGS 6
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 67cf7a57dac..8a0eab5ad52 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -58,6 +58,11 @@
 #include <cstring>
 #include <ctime>
 
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/util.h"
+
+
 namespace {
 /**
  * Converts the given path to only use slashes as
@@ -1300,7 +1305,7 @@ std::string getMSVCConfigName(MSVC_Architecture arch) {
 }
 
 FeatureList getAllFeatures() {
-	const size_t featureCount = sizeof(s_features) / sizeof(s_features[0]);
+	const size_t featureCount = ARRAYSIZE(s_features);
 
 	FeatureList features;
 	for (size_t i = 0; i < featureCount; ++i)
@@ -1523,7 +1528,7 @@ BuildSetup removeFeatureFromSetup(BuildSetup setup, const std::string &feature)
 }
 
 ToolList getAllTools() {
-	const size_t toolCount = sizeof(s_tools) / sizeof(s_tools[0]);
+	const size_t toolCount = ARRAYSIZE(s_tools);
 
 	ToolList tools;
 	for (size_t i = 0; i < toolCount; ++i)
@@ -1533,7 +1538,7 @@ ToolList getAllTools() {
 }
 
 MSVCList getAllMSVCVersions() {
-	const size_t msvcCount = sizeof(s_msvc) / sizeof(s_msvc[0]);
+	const size_t msvcCount = ARRAYSIZE(s_msvc);
 
 	MSVCList msvcVersions;
 	for (size_t i = 0; i < msvcCount; ++i)
@@ -1543,7 +1548,7 @@ MSVCList getAllMSVCVersions() {
 }
 
 const MSVCVersion *getMSVCVersion(int version) {
-	const size_t msvcCount = sizeof(s_msvc) / sizeof(s_msvc[0]);
+	const size_t msvcCount = ARRAYSIZE(s_msvc);
 
 	for (size_t i = 0; i < msvcCount; ++i) {
 		if (s_msvc[i].version == version)
diff --git a/devtools/create_tony/create_tony.h b/devtools/create_tony/create_tony.h
index 5fa9a596613..62e65bcbd3b 100644
--- a/devtools/create_tony/create_tony.h
+++ b/devtools/create_tony/create_tony.h
@@ -22,8 +22,6 @@
 #ifndef CREATE_TONY_H
 #define CREATE_TONY_H
 
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-
 #define DATAALIGNMENT 4
 
 #define TONY_DAT_VER_MAJ 0  // 1 byte
diff --git a/devtools/create_toon/create_toon.h b/devtools/create_toon/create_toon.h
index 03cacd59e04..f923b860f10 100644
--- a/devtools/create_toon/create_toon.h
+++ b/devtools/create_toon/create_toon.h
@@ -22,8 +22,6 @@
 #ifndef CREATE_TOON_H
 #define CREATE_TOON_H
 
-#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
-
 #define DATAALIGNMENT 4
 
 #define TOON_DAT_VER_MAJ 0  // 1 byte
diff --git a/devtools/qtable/qtable.cpp b/devtools/qtable/qtable.cpp
index 9857779965e..bdb773644f4 100644
--- a/devtools/qtable/qtable.cpp
+++ b/devtools/qtable/qtable.cpp
@@ -3,6 +3,11 @@
 #include <string.h>
 #include <assert.h>
 
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/util.h"
+
+
 /*
   Table file format for scummvm/queen
 	uint32 : 'QTBL'
@@ -19,7 +24,6 @@
 */
 
 #define MAX_VERSIONS  20
-#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
 
 typedef unsigned char   uint8;
 typedef unsigned short uint16;
@@ -70,7 +74,7 @@ typedef struct GameVersion {
 #include "fat_amiga_interview.h"
 #include "fat_amiga_ger_floppy.h" // https://bugs.scummvm.org/ticket/12313
 
-#define FAT(x) x, (sizeof(x)/sizeof(x[0]))
+#define FAT(x) x, (ARRAYSIZE(x))
 
 static GameVersion gameVersionsTable[] = {
 	{ "PEM10",  22677657, FAT(fatEngFl),          1, 0 },




More information about the Scummvm-git-logs mailing list