From b7a5fd9e90f27f5779539b13330c859c07acda9d Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 14 Mar 2011 14:26:29 -0400 Subject: [PATCH] More warning squishing. Make a note of LuaManager: either define the needed items or hide them away. --- Xcode/stepmania.xcodeproj/project.pbxproj | 8 ++++---- src/Course.h | 15 +++------------ src/LuaManager.h | 6 ++++++ src/RageUtil_CachedObject.h | 3 +-- src/StepsUtil.h | 9 +++------ src/UnlockManager.h | 16 ++++++++-------- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index 97d4084dcc..877b9051bc 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7116,7 +7116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7652,7 +7652,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -7987,7 +7987,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; @@ -8116,7 +8116,7 @@ GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO; + GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_MISSING_PARENTHESES = YES; diff --git a/src/Course.h b/src/Course.h index b83b627334..772871ab30 100644 --- a/src/Course.h +++ b/src/Course.h @@ -55,18 +55,9 @@ public: float fGainSeconds; // time gained back at the beginning of the song. LifeMeterTime only. int iGainLives; // lives gained back at the beginning of the next song - CourseEntry() - { - bSecret = false; - bNoDifficult = false; - - songSort = SongSort_Randomize; - iChooseIndex = 0; - - sModifiers = ""; - fGainSeconds = 0; - iGainLives = -1; - } + CourseEntry(): bSecret(false), bNoDifficult(false), + songSort(SongSort_Randomize), iChooseIndex(0), + sModifiers(RString("")), fGainSeconds(0), iGainLives(-1) {} bool IsFixedSong() const { return songID.IsValid(); } diff --git a/src/LuaManager.h b/src/LuaManager.h index 08beb9aa0d..0a55d343ab 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -42,6 +42,9 @@ public: private: lua_State *m_pLuaMain; + // Swallow up warnings. If they must be used, define them. + LuaManager& operator=(const LuaManager& rhs); + LuaManager(const LuaManager& rhs); }; extern LuaManager *LUA; @@ -155,6 +158,9 @@ private: LuaReference *m_Name; LuaReference *m_pOldValue; + + // Swallow up warnings. If they must be used, define them. + LuaThreadVariable& operator=(const LuaThreadVariable& rhs); }; /** diff --git a/src/RageUtil_CachedObject.h b/src/RageUtil_CachedObject.h index a7b1e94180..421c8d3328 100644 --- a/src/RageUtil_CachedObject.h +++ b/src/RageUtil_CachedObject.h @@ -112,9 +112,8 @@ class CachedObjectPointer public: typedef CachedObject Object; - CachedObjectPointer() + CachedObjectPointer() : m_pCache(NULL), m_bCacheIsSet(false) { - m_bCacheIsSet = false; Object::Register( this ); } diff --git a/src/StepsUtil.h b/src/StepsUtil.h index 628f01c6ed..cae7cdb1c3 100644 --- a/src/StepsUtil.h +++ b/src/StepsUtil.h @@ -48,15 +48,12 @@ public: } /** @brief The Song's locked status. */ m_Locked; /** @brief Set up the initial criteria. */ - StepsCriteria() + StepsCriteria(): m_difficulty(Difficulty_Invalid), + m_iLowMeter(-1), m_iHighMeter(-1), + m_st(StepsType_Invalid), m_Locked(Locked_DontCare) { - m_difficulty = Difficulty_Invalid; - m_iLowMeter = -1; - m_iHighMeter = -1; //m_fLowBPM = -1; //m_fHighBPM = -1; - m_st = StepsType_Invalid; - m_Locked = Locked_DontCare; } /** diff --git a/src/UnlockManager.h b/src/UnlockManager.h index 9eaaad40cf..06b3ed7b3e 100644 --- a/src/UnlockManager.h +++ b/src/UnlockManager.h @@ -52,16 +52,16 @@ enum UnlockEntryStatus { class UnlockEntry { public: - UnlockEntry() + /** + * @brief Set up the UnlockEntry with default values. + * + * m_sEntryID starts as an empty string. It will be filled automatically + * if not specified. */ + UnlockEntry(): m_Type(UnlockRewardType_Invalid), + m_dc(Difficulty_Invalid), m_bRequirePassHardSteps(false), + m_bRoulette(false), m_sEntryID(RString("")) { - m_Type = UnlockRewardType_Invalid; - - m_dc = Difficulty_Invalid; - ZERO( m_fRequirement ); - m_bRequirePassHardSteps = false; - m_bRoulette = false; - m_sEntryID = ""; // "" means not yet filled. This will be filled in automatically if not specified. } UnlockRewardType m_Type;