Skip to content

Commit 43f977e

Browse files
authored
refactor: Remove ELEMENTS_OF macro (#1588)
1 parent dd2bb78 commit 43f977e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Core/Libraries/Include/Lib/BaseTypeCore.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@
117117
#define FALSE false
118118
#endif
119119

120-
// Elements in an array
121-
#ifndef ELEMENTS_OF
122-
#define ELEMENTS_OF( x ) ( sizeof( x ) / sizeof( x[0] ) )
123-
#endif
124-
125120
//--------------------------------------------------------------------
126121
// Fundamental type definitions
127122
//--------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameClient/Eva.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void Eva::update()
316316
//-------------------------------------------------------------------------------------------------
317317
EvaMessage Eva::nameToMessage(const AsciiString& name)
318318
{
319-
DEBUG_ASSERTCRASH( ELEMENTS_OF( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
319+
DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
320320
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
321321
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );
322322

@@ -333,7 +333,7 @@ EvaMessage Eva::nameToMessage(const AsciiString& name)
333333
//-------------------------------------------------------------------------------------------------
334334
AsciiString Eva::messageToName(EvaMessage message)
335335
{
336-
DEBUG_ASSERTCRASH( ELEMENTS_OF( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
336+
DEBUG_ASSERTCRASH( ARRAY_SIZE( TheEvaMessageNames ) == EVA_COUNT + 1, ("TheEvaMessageNames out of sync" ) );
337337
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT ], "EVA_INVALID" ) == 0, ("TheEvaMessageNames out of sync" ) );
338338
DEBUG_ASSERTCRASH( stricmp( TheEvaMessageNames[ EVA_COUNT - 1], "EVA_INVALID" ) != 0, ("TheEvaMessageNames out of sync" ) );
339339

@@ -415,7 +415,7 @@ Bool Eva::messageShouldPlay(EvaMessage messageToTest, UnsignedInt currentFrame)
415415
return FALSE;
416416
}
417417

418-
DEBUG_ASSERTCRASH( ELEMENTS_OF( s_shouldPlayFuncs ) == EVA_COUNT + 1, ("Eva::s_shouldPlayFuncs out of sync" ) );
418+
DEBUG_ASSERTCRASH( ARRAY_SIZE( s_shouldPlayFuncs ) == EVA_COUNT + 1, ("Eva::s_shouldPlayFuncs out of sync" ) );
419419
DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT ] == NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );
420420
DEBUG_ASSERTCRASH( s_shouldPlayFuncs[ EVA_COUNT - 1] != NULL, ("Eva::s_shouldPlayFuncs out of sync" ) );
421421

0 commit comments

Comments
 (0)