From df8845c6f6094c3a6b96d7e504a237fb119b4661 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 3 Feb 2024 00:22:01 +0100 Subject: [PATCH] re-use _countof + add parentheses --- LEGO1/lego/legoomni/src/act1/act1state.cpp | 4 +--- util/decomp.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/src/act1/act1state.cpp b/LEGO1/lego/legoomni/src/act1/act1state.cpp index 1fbbf78c..6d96d14f 100644 --- a/LEGO1/lego/legoomni/src/act1/act1state.cpp +++ b/LEGO1/lego/legoomni/src/act1/act1state.cpp @@ -4,8 +4,6 @@ DECOMP_SIZE_ASSERT(Act1State, 0x26c) DECOMP_SIZE_ASSERT(Act1State::NamedPlane, 0x4c) DECOMP_SIZE_ASSERT(Act1State::NamedTexture, 0x14) -#define isle_asize(ARR) (sizeof(ARR) / sizeof((ARR)[0])) - // Forward declarations Act1State::NamedTexture* ReadNamedTexture(LegoFile* p_file); void WriteNamedTexture(LegoFile* p_file, Act1State::NamedTexture* p_texture); @@ -43,7 +41,7 @@ Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x m_unk0x1b0 = NULL; m_unk0x021 = 1; m_unk0x01c = 1; - m_unk0x00c = isle_asize(g_unk0x100f37f0); + m_unk0x00c = _countof(g_unk0x100f37f0); m_unk0x1b4 = NULL; m_unk0x1b8 = NULL; m_unk0x208 = NULL; diff --git a/util/decomp.h b/util/decomp.h index 3470fcc3..100f9f21 100644 --- a/util/decomp.h +++ b/util/decomp.h @@ -14,7 +14,7 @@ #endif #ifndef _countof -#define _countof(arr) sizeof(arr) / sizeof(arr[0]) +#define _countof(arr) (sizeof(arr) / sizeof(arr[0])) #endif typedef unsigned char undefined;