[Scummvm-git-logs] scummvm master -> fc6bb6eaac62d8649d981ff658aa108ac33fdfda
bluegr
noreply at scummvm.org
Sun Feb 15 20:45:17 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:
fc6bb6eaac JANITORIAL: use common ARRAYSIZE macro
Commit: fc6bb6eaac62d8649d981ff658aa108ac33fdfda
https://github.com/scummvm/scummvm/commit/fc6bb6eaac62d8649d981ff658aa108ac33fdfda
Author: Michael Kuerbis (michael_kuerbis at web.de)
Date: 2026-02-15T22:45:14+02:00
Commit Message:
JANITORIAL: use common ARRAYSIZE macro
Changed paths:
audio/softsynth/mt32/Synth.cpp
audio/softsynth/sid.cpp
image/codecs/indeo/mem.h
test/image/blending.h
diff --git a/audio/softsynth/mt32/Synth.cpp b/audio/softsynth/mt32/Synth.cpp
index 0b81edb9341..006aad4db4f 100644
--- a/audio/softsynth/mt32/Synth.cpp
+++ b/audio/softsynth/mt32/Synth.cpp
@@ -33,6 +33,9 @@
#include "ROMInfo.h"
#include "TVA.h"
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include "common/util.h"
+
#if MT32EMU_MONITOR_SYSEX > 0
#include "mmath.h"
#endif
@@ -575,7 +578,7 @@ bool Synth::loadControlROM(const ROMImage &controlROMImage) {
// Control ROM successfully loaded, now check whether it's a known type
controlROMMap = NULL;
controlROMFeatures = NULL;
- for (unsigned int i = 0; i < sizeof(ControlROMMaps) / sizeof(ControlROMMaps[0]); i++) {
+ for (unsigned int i = 0; i < ARRAYSIZE(ControlROMMaps); i++) {
if (strcmp(controlROMInfo->shortName, ControlROMMaps[i].shortName) == 0) {
controlROMMap = &ControlROMMaps[i];
controlROMFeatures = &controlROMMap->featureSet;
diff --git a/audio/softsynth/sid.cpp b/audio/softsynth/sid.cpp
index dca5018e6e5..1ba13cccd6a 100644
--- a/audio/softsynth/sid.cpp
+++ b/audio/softsynth/sid.cpp
@@ -496,14 +496,14 @@ Filter::Filter() {
// Create mappings from FC to cutoff frequency.
interpolate(f0_points_6581, f0_points_6581
- + sizeof(f0_points_6581)/sizeof(*f0_points_6581) - 1,
+ + ARRAYSIZE(f0_points_6581) - 1,
PointPlotter<sound_sample>(f0_6581), 1.0);
mixer_DC = (-0xfff*0xff/18) >> 7;
f0 = f0_6581;
f0_points = f0_points_6581;
- f0_count = sizeof(f0_points_6581)/sizeof(*f0_points_6581);
+ f0_count = ARRAYSIZE(f0_points_6581);
set_w0();
set_Q();
diff --git a/image/codecs/indeo/mem.h b/image/codecs/indeo/mem.h
index 17ffb0924c4..8b136e73954 100644
--- a/image/codecs/indeo/mem.h
+++ b/image/codecs/indeo/mem.h
@@ -20,6 +20,7 @@
*/
#include "common/scummsys.h"
+#include "common/util.h"
/* Common memory code used by the Indeo decoder
*
@@ -33,7 +34,7 @@
namespace Image {
namespace Indeo {
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#define FF_ARRAY_ELEMS(a) ARRAYSIZE(a)
#define FFALIGN(x, a) (((x) + (a)-1) & ~((a)-1))
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
#define MAX_INTEGER 0x7ffffff
diff --git a/test/image/blending.h b/test/image/blending.h
index 0850857d358..80bcb80fde8 100644
--- a/test/image/blending.h
+++ b/test/image/blending.h
@@ -29,6 +29,7 @@
#include "common/fs.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/util.h"
#include "graphics/surface.h"
#include "graphics/managed_surface.h"
@@ -984,7 +985,7 @@ public:
for (int g = 255; g >= 0; g = (g == 255 ? 128 : (g == 128 ? 0 : -1))) {
for (int b = 255; b >= 0; b = (b == 255 ? 128 : (b == 128 ? 0 : -1))) {
for (int flipping = 0; flipping <= 3; flipping++) {
- for (int rect = 0; rect < (int)(sizeof(srcs)/sizeof(srcs[0])); rect++) {
+ for (int rect = 0; rect < ARRAYSIZE(srcs); rect++) {
oldSurfDest.fillRect(Common::Rect(0, 0, oldSurfDest.w, oldSurfDest.h), oldSurfDest.format.ARGBToColor(ba, br, bg, bb));
oldSurf._alphaMode = (Graphics::AlphaType)alphaType;
oldSurf.blit(oldSurfDest, dsts[rect].left, dsts[rect].top, flipping, &srcs[rect], MS_ARGB(a, r, g, b), dsts[rect].width(), dsts[rect].height(), (Graphics::TSpriteBlendMode)blendMode);
More information about the Scummvm-git-logs
mailing list