force TypeName arrays for XToString to be an array of const char*, not CString
This commit is contained in:
@@ -497,7 +497,7 @@ void ActorUtil::SortByZPosition( vector<Actor*> &vActors )
|
||||
stable_sort( vActors.begin(), vActors.end(), CompareActorsByZPosition );
|
||||
}
|
||||
|
||||
static const CString FileTypeNames[] = {
|
||||
static const char *FileTypeNames[] = {
|
||||
"Bitmap",
|
||||
"Movie",
|
||||
"Directory",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "RageUtil.h"
|
||||
#include "PlayerState.h"
|
||||
|
||||
const CString CodeNames[] = {
|
||||
const char *CodeNames[] = {
|
||||
"Easier1",
|
||||
"Easier2",
|
||||
"Harder1",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "LuaFunctions.h"
|
||||
|
||||
|
||||
static const CString CourseTypeNames[] = {
|
||||
static const char *CourseTypeNames[] = {
|
||||
"Nonstop",
|
||||
"Oni",
|
||||
"Endless",
|
||||
@@ -36,7 +36,7 @@ XToThemedString( CourseType, NUM_CourseType );
|
||||
LuaFunction( CourseTypeToThemedString, CourseTypeToThemedString((CourseType) IArg(1)) );
|
||||
|
||||
|
||||
static const CString SongSortNames[] = {
|
||||
static const char *SongSortNames[] = {
|
||||
"Randomize",
|
||||
"MostPlays",
|
||||
"FewestPlays",
|
||||
|
||||
@@ -158,7 +158,7 @@ CString LastDayToString( int iLastDayIndex )
|
||||
return LAST_DAYS_NAME[iLastDayIndex];
|
||||
}
|
||||
|
||||
static const CString DAY_OF_WEEK_TO_NAME[DAYS_IN_WEEK] =
|
||||
static const char *DAY_OF_WEEK_TO_NAME[DAYS_IN_WEEK] =
|
||||
{
|
||||
"Sunday",
|
||||
"Monday",
|
||||
@@ -179,7 +179,7 @@ CString HourInDayToString( int iHourInDayIndex )
|
||||
return ssprintf("Hour%02d", iHourInDayIndex);
|
||||
}
|
||||
|
||||
static const CString MonthNames[] =
|
||||
static const char *MonthNames[] =
|
||||
{
|
||||
"January",
|
||||
"February",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "LuaFunctions.h"
|
||||
|
||||
|
||||
static const CString DifficultyNames[] = {
|
||||
static const char *DifficultyNames[] = {
|
||||
"Beginner",
|
||||
"Easy",
|
||||
"Medium",
|
||||
@@ -60,7 +60,7 @@ REGISTER_WITH_LUA_FUNCTION( LuaDifficulty );
|
||||
|
||||
|
||||
|
||||
static const CString CourseDifficultyNames[] =
|
||||
static const char *CourseDifficultyNames[] =
|
||||
{
|
||||
"Beginner",
|
||||
"Easy",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "SongUtil.h"
|
||||
|
||||
|
||||
static const CString EditMenuRowNames[] = {
|
||||
static const char *EditMenuRowNames[] = {
|
||||
"Group",
|
||||
"Song",
|
||||
"StepsType",
|
||||
@@ -27,7 +27,7 @@ static const CString EditMenuRowNames[] = {
|
||||
XToString( EditMenuRow, NUM_EDIT_MENU_ROWS );
|
||||
XToThemedString( EditMenuRow, NUM_EDIT_MENU_ROWS );
|
||||
|
||||
static const CString EditMenuActionNames[] = {
|
||||
static const char *EditMenuActionNames[] = {
|
||||
"Edit",
|
||||
"Delete",
|
||||
"Create",
|
||||
|
||||
@@ -45,14 +45,23 @@ static inline T enum_add2( T val, int iAmt )
|
||||
|
||||
static const CString EMPTY_STRING;
|
||||
|
||||
// TypeName[] must be an array of const char *, not RString, to
|
||||
// avoid initialization order problems when calling XToString.
|
||||
static void CheckXToStringParamType( const char **p ) { }
|
||||
#define XToString(X, CNT) \
|
||||
const CString& X##ToString( X x ) \
|
||||
{ \
|
||||
CheckXToStringParamType( X##Names ); \
|
||||
static auto_ptr<CString> as_##X##Name[CNT]; \
|
||||
if( as_##X##Name[0].get() == NULL ) { \
|
||||
for( unsigned i = 0; i < CNT; ++i ) \
|
||||
as_##X##Name[i].reset( new CString(X##Names[i]) ); \
|
||||
} \
|
||||
ASSERT( CNT == ARRAYSIZE(X##Names) ); \
|
||||
if( x == CNT+1 ) \
|
||||
return EMPTY_STRING; \
|
||||
ASSERT( x < CNT ); \
|
||||
return X##Names[x]; \
|
||||
return *as_##X##Name[x]; \
|
||||
}
|
||||
|
||||
#define XToThemedString(X, CNT) \
|
||||
|
||||
@@ -15,7 +15,7 @@ const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"};
|
||||
|
||||
extern const CString GROUP_ALL = "---Group All---";
|
||||
|
||||
static const CString RadarCategoryNames[] = {
|
||||
static const char *RadarCategoryNames[] = {
|
||||
"Stream",
|
||||
"Voltage",
|
||||
"Air",
|
||||
@@ -56,7 +56,7 @@ static void LuaStepsType(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaStepsType );
|
||||
|
||||
|
||||
static const CString PlayModeNames[] = {
|
||||
static const char *PlayModeNames[] = {
|
||||
"Regular",
|
||||
"Nonstop",
|
||||
"Oni",
|
||||
@@ -80,7 +80,7 @@ RankingCategory AverageMeterToRankingCategory( int iAverageMeter )
|
||||
}
|
||||
|
||||
|
||||
static const CString RankingCategoryNames[] = {
|
||||
static const char *RankingCategoryNames[] = {
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
@@ -90,7 +90,7 @@ XToString( RankingCategory, NUM_RANKING_CATEGORIES );
|
||||
StringToX( RankingCategory );
|
||||
|
||||
|
||||
static const CString PlayerControllerNames[] = {
|
||||
static const char *PlayerControllerNames[] = {
|
||||
"Human",
|
||||
"Autoplay",
|
||||
"Cpu",
|
||||
@@ -98,7 +98,7 @@ static const CString PlayerControllerNames[] = {
|
||||
XToString( PlayerController, NUM_PLAYER_CONTROLLERS );
|
||||
|
||||
|
||||
static const CString CoinModeNames[] = {
|
||||
static const char *CoinModeNames[] = {
|
||||
"home",
|
||||
"pay",
|
||||
"free",
|
||||
@@ -116,7 +116,7 @@ static void LuaCoinMode(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaCoinMode );
|
||||
|
||||
|
||||
static const CString PremiumNames[] = {
|
||||
static const char *PremiumNames[] = {
|
||||
"none",
|
||||
"double",
|
||||
"joint",
|
||||
@@ -134,7 +134,7 @@ static void LuaPremium(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaPremium );
|
||||
|
||||
|
||||
static const CString SortOrderNames[] = {
|
||||
static const char *SortOrderNames[] = {
|
||||
"Preferred",
|
||||
"Group",
|
||||
"Title",
|
||||
@@ -180,7 +180,7 @@ static void LuaSortOrder(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaSortOrder );
|
||||
|
||||
|
||||
static const CString TapNoteScoreNames[] = {
|
||||
static const char *TapNoteScoreNames[] = {
|
||||
"None",
|
||||
"HitMine",
|
||||
"AvoidMine",
|
||||
@@ -227,7 +227,7 @@ static void LuaTapNoteScores( lua_State* L )
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaTapNoteScores );
|
||||
|
||||
|
||||
static const CString HoldNoteScoreNames[] = {
|
||||
static const char *HoldNoteScoreNames[] = {
|
||||
"None",
|
||||
"LetGo",
|
||||
"Held",
|
||||
@@ -258,7 +258,7 @@ static void LuaHoldNoteScores( lua_State* L )
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaHoldNoteScores );
|
||||
|
||||
|
||||
static const CString MemoryCardStateNames[] = {
|
||||
static const char *MemoryCardStateNames[] = {
|
||||
"ready",
|
||||
"checking",
|
||||
"late",
|
||||
@@ -269,7 +269,7 @@ static const CString MemoryCardStateNames[] = {
|
||||
XToString( MemoryCardState, NUM_MemoryCardState );
|
||||
|
||||
|
||||
static const CString PerDifficultyAwardNames[] = {
|
||||
static const char *PerDifficultyAwardNames[] = {
|
||||
"FullComboW3",
|
||||
"SingleDigitW3",
|
||||
"OneW3",
|
||||
@@ -296,7 +296,7 @@ REGISTER_WITH_LUA_FUNCTION( LuaPerDifficultyAward );
|
||||
// strings can be used as XML entity names.
|
||||
// Numbers are intentially not at the back so that "1000" and "10000" don't
|
||||
// conflict when searching for theme elements.
|
||||
static const CString PeakComboAwardNames[] = {
|
||||
static const char *PeakComboAwardNames[] = {
|
||||
"Peak1000Combo",
|
||||
"Peak2000Combo",
|
||||
"Peak3000Combo",
|
||||
@@ -368,7 +368,7 @@ bool DisplayBpms::IsSecret() const
|
||||
return false;
|
||||
}
|
||||
|
||||
static const CString StyleTypeNames[] = {
|
||||
static const char *StyleTypeNames[] = {
|
||||
"OnePlayerOneSide",
|
||||
"TwoPlayersTwoSides",
|
||||
"OnePlayerTwoSides",
|
||||
@@ -377,7 +377,7 @@ XToString( StyleType, NUM_STYLE_TYPES );
|
||||
StringToX( StyleType );
|
||||
|
||||
|
||||
static const CString MenuDirNames[] = {
|
||||
static const char *MenuDirNames[] = {
|
||||
"Up",
|
||||
"Down",
|
||||
"Left",
|
||||
@@ -387,7 +387,7 @@ static const CString MenuDirNames[] = {
|
||||
XToString( MenuDir, NUM_MENU_DIRS );
|
||||
|
||||
|
||||
static const CString GoalTypeNames[] = {
|
||||
static const char *GoalTypeNames[] = {
|
||||
"Calories",
|
||||
"Time",
|
||||
"None",
|
||||
@@ -406,7 +406,7 @@ static void LuaGoalType(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaGoalType );
|
||||
|
||||
|
||||
static const CString StageNames[] = {
|
||||
static const char *StageNames[] = {
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "Game.h"
|
||||
|
||||
|
||||
static const CString GameControllerNames[] = {
|
||||
static const char *GameControllerNames[] = {
|
||||
"Controller1",
|
||||
"Controller2",
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ Preference<float> g_fLightsFalloffSeconds( "LightsFalloffSeconds", 0.1f );
|
||||
Preference<float> g_fLightsAheadSeconds( "LightsAheadSeconds", 0.05f );
|
||||
|
||||
|
||||
static const CString CabinetLightNames[] = {
|
||||
static const char *CabinetLightNames[] = {
|
||||
"MarqueeUpLeft",
|
||||
"MarqueeUpRight",
|
||||
"MarqueeLrLeft",
|
||||
@@ -36,7 +36,7 @@ static const CString CabinetLightNames[] = {
|
||||
XToString( CabinetLight, NUM_CABINET_LIGHTS );
|
||||
StringToX( CabinetLight );
|
||||
|
||||
static const CString LightsModeNames[] = {
|
||||
static const char *LightsModeNames[] = {
|
||||
"Attract",
|
||||
"Joining",
|
||||
"Menu",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
MessageManager* MESSAGEMAN = NULL; // global and accessable from anywhere in our program
|
||||
|
||||
|
||||
static const CString MessageNames[] = {
|
||||
static const char *MessageNames[] = {
|
||||
"CurrentGameChanged",
|
||||
"CurrentStyleChanged",
|
||||
"PlayModeChanged",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
const CString& NoteNotePartToString( NotePart i );
|
||||
#define FOREACH_NotePart( i ) FOREACH_ENUM( NotePart, NUM_NotePart, i )
|
||||
|
||||
static const CString NotePartNames[] = {
|
||||
static const char *NotePartNames[] = {
|
||||
"TapNote",
|
||||
"TapAddition",
|
||||
"TapMine",
|
||||
@@ -222,13 +222,13 @@ void NoteColorSprite::Load( const CString &sButton, const CString &sElement )
|
||||
}
|
||||
|
||||
|
||||
static const CString HoldTypeNames[] = {
|
||||
static const char *HoldTypeNames[] = {
|
||||
"hold",
|
||||
"roll",
|
||||
};
|
||||
XToString( HoldType, NUM_HOLD_TYPES );
|
||||
|
||||
static const CString ActiveTypeNames[] = {
|
||||
static const char *ActiveTypeNames[] = {
|
||||
"active",
|
||||
"inactive",
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ TapNote TAP_ORIGINAL_AUTO_KEYSOUND ( TapNote::autoKeysound,TapNote::SubType_inva
|
||||
TapNote TAP_ADDITION_TAP ( TapNote::tap, TapNote::SubType_invalid, TapNote::addition, "", 0, false, 0 );
|
||||
TapNote TAP_ADDITION_MINE ( TapNote::mine, TapNote::SubType_invalid, TapNote::addition, "", 0, false, 0 );
|
||||
|
||||
static const CString NoteTypeNames[] = {
|
||||
static const char *NoteTypeNames[] = {
|
||||
"4th",
|
||||
"8th",
|
||||
"12th",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Style.h"
|
||||
#include "ActorUtil.h"
|
||||
|
||||
static const CString SelectTypeNames[] = {
|
||||
static const char *SelectTypeNames[] = {
|
||||
"SelectOne",
|
||||
"SelectMultiple",
|
||||
"SelectNone",
|
||||
@@ -19,7 +19,7 @@ static const CString SelectTypeNames[] = {
|
||||
XToString( SelectType, NUM_SELECT_TYPES );
|
||||
StringToX( SelectType );
|
||||
|
||||
static const CString LayoutTypeNames[] = {
|
||||
static const char *LayoutTypeNames[] = {
|
||||
"ShowAllInRow",
|
||||
"ShowOneInRow",
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "LuaManager.h"
|
||||
#include "ThemeMetric.h"
|
||||
|
||||
static const CString PlayerNumberNames[] = {
|
||||
static const char *PlayerNumberNames[] = {
|
||||
"P1",
|
||||
"P2",
|
||||
};
|
||||
@@ -20,7 +20,7 @@ void LuaPlayerNumber(lua_State* L)
|
||||
REGISTER_WITH_LUA_FUNCTION( LuaPlayerNumber );
|
||||
|
||||
|
||||
static const CString MultiPlayerNames[] = {
|
||||
static const char *MultiPlayerNames[] = {
|
||||
"P1",
|
||||
"P2",
|
||||
"P3",
|
||||
|
||||
@@ -18,7 +18,7 @@ const CString TYPE_TXT_FILE = "Data/Type.txt";
|
||||
|
||||
PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program
|
||||
|
||||
static const CString TimingWindowNames[] = {
|
||||
static const char *TimingWindowNames[] = {
|
||||
"W1",
|
||||
"W2",
|
||||
"W3",
|
||||
@@ -32,7 +32,7 @@ static const CString TimingWindowNames[] = {
|
||||
XToString( TimingWindow, NUM_TimingWindow );
|
||||
|
||||
|
||||
static const CString ScoreEventNames[] = {
|
||||
static const char *ScoreEventNames[] = {
|
||||
"W1",
|
||||
"W2",
|
||||
"W3",
|
||||
|
||||
@@ -35,7 +35,7 @@ RageDisplay* DISPLAY = NULL;
|
||||
Preference<bool> LOG_FPS( "LogFPS", true );
|
||||
Preference<float> g_fFrameLimitPercent( "FrameLimitPercent", 0.0f );
|
||||
|
||||
static const CString PixelFormatNames[] = {
|
||||
static const char *PixelFormatNames[] = {
|
||||
"RGBA8",
|
||||
"RGBA4",
|
||||
"RGB5A1",
|
||||
|
||||
@@ -169,7 +169,7 @@ DeviceButton StringToDeviceButton( const CString& s )
|
||||
}
|
||||
|
||||
|
||||
static const CString InputDeviceNames[] = {
|
||||
static const char *InputDeviceNames[] = {
|
||||
"Key",
|
||||
"Joy1",
|
||||
"Joy2",
|
||||
|
||||
@@ -77,7 +77,7 @@ AutoScreenMessage( SM_DoExit )
|
||||
AutoScreenMessage( SM_SaveSuccessful );
|
||||
AutoScreenMessage( SM_SaveFailed );
|
||||
|
||||
static const CString EditStateNames[] = {
|
||||
static const char *EditStateNames[] = {
|
||||
"Edit",
|
||||
"Record",
|
||||
"RecordPaused",
|
||||
|
||||
@@ -39,14 +39,14 @@ const int NUM_SCORE_DIGITS = 9;
|
||||
// metrics that are common to all ScreenEvaluation classes
|
||||
#define BANNER_WIDTH THEME->GetMetricF(m_sName,"BannerWidth")
|
||||
#define BANNER_HEIGHT THEME->GetMetricF(m_sName,"BannerHeight")
|
||||
static const CString JudgeLineNames[] =
|
||||
static const char *JudgeLineNames[] =
|
||||
{
|
||||
"W1", "W2", "W3", "W4", "W5", "Miss", "Held", "MaxCombo", "TotalError"
|
||||
};
|
||||
XToString( JudgeLine, NUM_JudgeLine );
|
||||
#define FOREACH_JudgeLine( rc ) FOREACH_ENUM( JudgeLine, NUM_JudgeLine, rc )
|
||||
|
||||
static const CString StatLineNames[NUM_StatLine] =
|
||||
static const char *StatLineNames[NUM_StatLine] =
|
||||
{
|
||||
"Jumps", "Holds", "Mines", "Hands", "Rolls",
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "PercentageDisplay.h"
|
||||
|
||||
|
||||
static const CString MultiplayerJudgeLineNames[] = {
|
||||
static const char *MultiplayerJudgeLineNames[] = {
|
||||
"W1",
|
||||
"W2",
|
||||
"W3",
|
||||
|
||||
@@ -15,7 +15,7 @@ class Style;
|
||||
#include "InputEventPlus.h"
|
||||
#include "LocalizedString.h"
|
||||
|
||||
static const CString MultiPlayerStatusNames[] = {
|
||||
static const char *MultiPlayerStatusNames[] = {
|
||||
"Joined",
|
||||
"NotJoined",
|
||||
"Unplugged",
|
||||
|
||||
@@ -28,7 +28,7 @@ enum CourseEntryAction
|
||||
CourseEntryAction_Delete,
|
||||
NUM_CourseEntryAction
|
||||
};
|
||||
static const CString CourseEntryActionNames[] = {
|
||||
static const char *CourseEntryActionNames[] = {
|
||||
"Edit",
|
||||
"Insert Entry",
|
||||
"Delete",
|
||||
|
||||
@@ -94,7 +94,7 @@ enum CourseAction
|
||||
CourseAction_Delete,
|
||||
NUM_CourseAction
|
||||
};
|
||||
static const CString CourseActionNames[] = {
|
||||
static const char *CourseActionNames[] = {
|
||||
"Edit",
|
||||
"Rename",
|
||||
"Delete",
|
||||
|
||||
@@ -24,7 +24,7 @@ enum StepsEditAction
|
||||
StepsEditAction_Delete,
|
||||
NUM_StepsEditAction
|
||||
};
|
||||
static const CString StepsEditActionNames[] = {
|
||||
static const char *StepsEditActionNames[] = {
|
||||
"Edit",
|
||||
"Rename",
|
||||
"Delete",
|
||||
|
||||
@@ -32,7 +32,7 @@ enum ProfileAction
|
||||
ProfileAction_Clear,
|
||||
NUM_ProfileAction
|
||||
};
|
||||
static const CString ProfileActionNames[] = {
|
||||
static const char *ProfileActionNames[] = {
|
||||
"SetDefaultP1",
|
||||
"SetDefaultP2",
|
||||
"Edit",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "ScreenDimensions.h"
|
||||
#include "PercentageDisplay.h"
|
||||
|
||||
static const CString PageTypeNames[] = {
|
||||
static const char *PageTypeNames[] = {
|
||||
"Category",
|
||||
"Course",
|
||||
"AllSteps",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
#include "InputEventPlus.h"
|
||||
|
||||
static const CString SetTimeSelectionNames[] = {
|
||||
static const char *SetTimeSelectionNames[] = {
|
||||
"Year",
|
||||
"Month",
|
||||
"Day",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
ThemeManager* THEME = NULL; // global object accessable from anywhere in the program
|
||||
|
||||
static const RString ElementCategoryNames[] = {
|
||||
static const char *ElementCategoryNames[] = {
|
||||
"BGAnimations",
|
||||
"Fonts",
|
||||
"Graphics",
|
||||
|
||||
@@ -19,7 +19,7 @@ UnlockManager* UNLOCKMAN = NULL; // global and accessable from anywhere in our p
|
||||
#define UNLOCK_NAMES THEME->GetMetric ("Unlocks","UnlockNames")
|
||||
#define UNLOCK(sLineName) THEME->GetMetric ("Unlocks",ssprintf("Unlock%s",sLineName.c_str()))
|
||||
|
||||
static CString UnlockTypeNames[] =
|
||||
static const char *UnlockTypeNames[] =
|
||||
{
|
||||
"ArcadePoints",
|
||||
"DancePoints",
|
||||
|
||||
Reference in New Issue
Block a user