diff --git a/src/Character.cpp b/src/Character.cpp index a925c8b563..82146c5b69 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -5,10 +5,9 @@ #include "RageTextureID.h" #include "ActorUtil.h" -Character::Character() -{ - m_iPreloadRefcount = 0; -} +Character::Character(): m_sCharDir(""), m_sCharacterID(""), + m_sDisplayName(""), m_sCardPath(""), m_sIconPath(""), + m_bUsableInRave(false), m_iPreloadRefcount(0) {} bool Character::Load( RString sCharDir ) { diff --git a/src/LocalizedString.h b/src/LocalizedString.h index 1e5c7256e8..9e6de64dd3 100644 --- a/src/LocalizedString.h +++ b/src/LocalizedString.h @@ -25,6 +25,8 @@ private: void CreateImpl(); RString m_sGroup, m_sName; ILocalizedStringImpl *m_pImpl; + // Swallow up warnings. If they must be used, define them. + LocalizedString& operator=(const LocalizedString& rhs); }; #endif diff --git a/src/RageFile.h b/src/RageFile.h index 700f4de36f..0db14ca949 100644 --- a/src/RageFile.h +++ b/src/RageFile.h @@ -6,8 +6,11 @@ #include "RageFileBasic.h" struct lua_State; -/* This is the high-level interface, which interfaces with RageFileObj implementations - * and RageFileManager. */ +/** + * @brief High-level file access. + * + * This is the high-level interface, which interfaces with RageFileObj + * implementations and RageFileManager. */ class RageFile: public RageFileBasic { public: @@ -81,6 +84,9 @@ private: RString m_Path; RString m_sError; int m_Mode; + + // Swallow up warnings. If they must be used, define them. + RageFile& operator=(const RageFile& rhs); }; /** @brief Convenience wrappers for reading binary files. */ diff --git a/src/RageFileBasic.h b/src/RageFileBasic.h index 8e42cb7c01..dfefaec812 100644 --- a/src/RageFileBasic.h +++ b/src/RageFileBasic.h @@ -152,6 +152,9 @@ private: * file, and no seeking is performed. */ bool m_bCRC32Enabled; uint32_t m_iCRC32; + + // Swallow up warnings. If they must be used, define them. + RageFileObj& operator=(const RageFileObj& rhs); }; #endif diff --git a/src/RageSound.cpp b/src/RageSound.cpp index 71ec55518b..836082b904 100644 --- a/src/RageSound.cpp +++ b/src/RageSound.cpp @@ -44,11 +44,8 @@ RageSoundParams::RageSoundParams(): m_fPitch(1.0f), m_fSpeed(1.0f), m_StartTime( RageZeroTimer ), StopMode(M_AUTO), m_bIsCriticalSound(false) {} -RageSoundLoadParams::RageSoundLoadParams() -{ - m_bSupportRateChanging = false; - m_bSupportPan = false; -} +RageSoundLoadParams::RageSoundLoadParams(): + m_bSupportRateChanging(false), m_bSupportPan(false) {} RageSound::RageSound(): m_Mutex( "RageSound" ), m_pSource(NULL), m_iStreamFrame(0), diff --git a/src/RageSoundManager.h b/src/RageSoundManager.h index 37525356ab..e558eb32d2 100644 --- a/src/RageSoundManager.h +++ b/src/RageSoundManager.h @@ -53,6 +53,9 @@ private: /* Prefs: */ float m_fMixVolume; float m_fVolumeOfNonCriticalSounds; + // Swallow up warnings. If they must be used, define them. + RageSoundManager& operator=(const RageSoundManager& rhs); + RageSoundManager(const RageSoundManager& rhs); }; extern RageSoundManager *SOUNDMAN; diff --git a/src/RageSoundReader_PitchChange.h b/src/RageSoundReader_PitchChange.h index 454ec12102..c7168f85ce 100644 --- a/src/RageSoundReader_PitchChange.h +++ b/src/RageSoundReader_PitchChange.h @@ -29,6 +29,8 @@ private: float m_fPitchRatio; float m_fLastSetSpeedRatio; float m_fLastSetPitchRatio; + // Swallow up warnings. If they must be used, define them. + RageSoundReader_PitchChange& operator=(const RageSoundReader_PitchChange& rhs); }; #endif diff --git a/src/RageSoundReader_ThreadedBuffer.h b/src/RageSoundReader_ThreadedBuffer.h index f13069251d..edb5295c5d 100644 --- a/src/RageSoundReader_ThreadedBuffer.h +++ b/src/RageSoundReader_ThreadedBuffer.h @@ -53,7 +53,8 @@ private: int iFramesBuffered; int iPositionOfFirstFrame; float fRate; - Mapping() { iFramesBuffered = iPositionOfFirstFrame = 0; fRate = 1.0f; } + Mapping(): iFramesBuffered(0), iPositionOfFirstFrame(0), + fRate(1.0f) {} }; list m_StreamPosition; diff --git a/src/RageThreads.cpp b/src/RageThreads.cpp index 0d6e1044a0..f806c6867b 100644 --- a/src/RageThreads.cpp +++ b/src/RageThreads.cpp @@ -65,7 +65,8 @@ struct ThreadSlot int m_iCurCheckpoint, m_iNumCheckpoints; const char *GetFormattedCheckpoint( int lineno ); - ThreadSlot() { Init(); } + ThreadSlot(): m_bUsed(false), m_iID(GetInvalidThreadId()), + m_pImpl(NULL), m_iCurCheckpoint(0), m_iNumCheckpoints(0) {} void Init() { m_iID = GetInvalidThreadId(); diff --git a/src/RageUtil_AutoPtr.h b/src/RageUtil_AutoPtr.h index 4cd03bdad6..01005c1724 100644 --- a/src/RageUtil_AutoPtr.h +++ b/src/RageUtil_AutoPtr.h @@ -127,16 +127,11 @@ public: T& operator*() { return *m_pPtr; } T* operator->() { return m_pPtr; } - explicit HiddenPtr( T *p = NULL ) - { - m_pPtr = p; - } + explicit HiddenPtr( T *p = NULL ): m_pPtr(p) {} - HiddenPtr( const HiddenPtr &cpy ) + HiddenPtr( const HiddenPtr &cpy ): m_pPtr(NULL) { - if( cpy.m_pPtr == NULL ) - m_pPtr = NULL; - else + if( cpy.m_pPtr != NULL ) m_pPtr = HiddenPtrTraits::Copy( cpy.m_pPtr ); } diff --git a/src/SongOptions.h b/src/SongOptions.h index 7a81c9fc45..a690b56ccd 100644 --- a/src/SongOptions.h +++ b/src/SongOptions.h @@ -46,8 +46,19 @@ public: }; SoundEffectType m_SoundEffectType; - - SongOptions() { Init(); }; + /** + * @brief Set up the SongOptions with reasonable defaults. + * + * This is taken from Init(), but uses the intended + * initialization lists. */ + SongOptions(): m_LifeType(LIFE_BAR), m_DrainType(DRAIN_NORMAL), + m_iBatteryLives(4), m_bAssistClap(false), + m_bAssistMetronome(false), m_fMusicRate(1.0f), + m_SpeedfMusicRate(1.0f), m_fHaste(0.0f), + m_SpeedfHaste(1.0f), m_AutosyncType(AUTOSYNC_OFF), + m_SoundEffectType(SOUNDEFFECT_OFF), + m_bStaticBackground(false), m_bRandomBGOnly(false), + m_bSaveScore(true), m_bSaveReplay(false) {}; void Init(); void Approach( const SongOptions& other, float fDeltaSeconds ); void GetMods( vector &AddTo ) const;