From 343dc2f6f165364b1c1229b1a4179a0b3f44f9d4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 3 Feb 2005 03:11:30 +0000 Subject: [PATCH] fix warnings --- stepmania/src/Difficulty.h | 4 ++-- stepmania/src/EnumHelper.h | 2 +- stepmania/src/GameConstantsAndTypes.h | 13 +++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/stepmania/src/Difficulty.h b/stepmania/src/Difficulty.h index 499c45fa13..e672409fc6 100644 --- a/stepmania/src/Difficulty.h +++ b/stepmania/src/Difficulty.h @@ -19,7 +19,7 @@ enum Difficulty }; #define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_DIFFICULTIES, dc ) const CString& DifficultyToString( Difficulty dc ); -CString DifficultyToThemedString( Difficulty dc ); +const CString& DifficultyToThemedString( Difficulty dc ); Difficulty StringToDifficulty( const CString& sDC ); @@ -29,7 +29,7 @@ typedef Difficulty CourseDifficulty; #define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_INVALID; cd=GetNextShownCourseDifficulty(cd) ) const CString& CourseDifficultyToString( Difficulty dc ); -CString CourseDifficultyToThemedString( Difficulty dc ); +const CString& CourseDifficultyToThemedString( Difficulty dc ); Difficulty StringToCourseDifficulty( const CString& sDC ); Difficulty GetNextShownCourseDifficulty( Difficulty pn ); diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index c8bb6884c1..73008415c9 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -48,7 +48,7 @@ static const CString EMPTY_STRING; #define XToThemedString(X, CNT) \ static ThemeMetric g_##X##Name[CNT]; \ - CString X##ToThemedString( X x ) \ + const CString &X##ToThemedString( X x ) \ { \ static bool bInitted = false; \ if( !bInitted ) { \ diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index 6cd1420c73..1925fc080b 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -32,7 +32,7 @@ enum RadarCategory }; #define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RADAR_CATEGORIES, rc ) const CString& RadarCategoryToString( RadarCategory cat ); -CString RadarCategoryToThemedString( RadarCategory cat ); +const CString& RadarCategoryToThemedString( RadarCategory cat ); @@ -87,7 +87,7 @@ enum PlayMode }; #define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PLAY_MODES, pm ) const CString& PlayModeToString( PlayMode pm ); -CString PlayModeToThemedString( PlayMode pm ); +const CString& PlayModeToThemedString( PlayMode pm ); PlayMode StringToPlayMode( const CString& s ); @@ -138,7 +138,7 @@ enum TapNoteScore { }; #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns ) const CString& TapNoteScoreToString( TapNoteScore tns ); -CString TapNoteScoreToThemedString( TapNoteScore tns ); +const CString& TapNoteScoreToThemedString( TapNoteScore tns ); TapNoteScore StringToTapNoteScore( const CString& str ); @@ -151,7 +151,8 @@ enum HoldNoteScore }; #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns ) const CString& HoldNoteScoreToString( HoldNoteScore hns ); -CString HoldNoteScoreToThemedString( HoldNoteScore hns ); +const CString& HoldNoteScoreToThemedString( HoldNoteScore hns ); + HoldNoteScore StringToHoldNoteScore( const CString& str ); @@ -294,7 +295,7 @@ enum PerDifficultyAward }; #define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS, pma ) const CString& PerDifficultyAwardToString( PerDifficultyAward pma ); -CString PerDifficultyAwardToThemedString( PerDifficultyAward pma ); +const CString& PerDifficultyAwardToThemedString( PerDifficultyAward pma ); PerDifficultyAward StringToPerDifficultyAward( const CString& pma ); @@ -315,7 +316,7 @@ enum PeakComboAward }; #define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PEAK_COMBO_AWARDS, pca ) const CString& PeakComboAwardToString( PeakComboAward pma ); -CString PeakComboAwardToThemedString( PeakComboAward pma ); +const CString& PeakComboAwardToThemedString( PeakComboAward pma ); PeakComboAward StringToPeakComboAward( const CString& pma );