From e892ecc0274096f9c8edb3aaed6c2b491a6bc6a1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 2 Aug 2003 20:05:46 +0000 Subject: [PATCH] use ARRAYSIZE macro --- stepmania/src/InputMapper.cpp | 3 +-- stepmania/src/NotesLoader.cpp | 4 ++-- stepmania/src/OptionIcon.cpp | 3 +-- stepmania/src/OptionIconRow.cpp | 3 +-- stepmania/src/RageUtil.h | 2 +- stepmania/src/ScreenNameEntry.cpp | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/stepmania/src/InputMapper.cpp b/stepmania/src/InputMapper.cpp index b9078617b9..a154fc7116 100644 --- a/stepmania/src/InputMapper.cpp +++ b/stepmania/src/InputMapper.cpp @@ -225,7 +225,6 @@ const AutoJoyMapping g_AutoJoyMappings[] = } }, }; -const int NUM_AUTO_JOY_MAPPINGS = ARRAYSIZE(g_AutoJoyMappings); void InputMapper::AutoMapJoysticksForCurrentGame() { @@ -240,7 +239,7 @@ void InputMapper::AutoMapJoysticksForCurrentGame() { InputDevice device = vDevices[i]; CString sDescription = vDescriptions[i]; - for( int j=0; jRelease(); (p)=NULL; } } #define ZERO(x) memset(&x, 0, sizeof(x)) -#define COPY(a,b) { ASSERT(sizeof(a)==sizeof(b)); memcpy(&a, &b, sizeof(a)); } +#define COPY(a,b) { ASSERT(sizeof(a)==sizeof(b)); memcpy(&(a), &(b), sizeof(a)); } #define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0])) /* Common harmless mismatches. All min(T,T) and max(T,T) cases are handled diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index c3c5727f19..47ddb077ae 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -60,7 +60,7 @@ const char NAME_CHARS[] = { ' ',' ',' ',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' }; -#define NUM_NAME_CHARS (sizeof(NAME_CHARS)/sizeof(char)) +#define NUM_NAME_CHARS (ARRAYSIZE(NAME_CHARS)) #define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY)