More warning reductions, even if not noticed.

We're in the lower 40Ks now with Effective C++
Violations being checked.
This commit is contained in:
Jason Felds
2011-03-14 12:15:33 -04:00
parent d03e6a89fb
commit c5fda59080
7 changed files with 38 additions and 45 deletions
+9 -11
View File
@@ -32,7 +32,10 @@ struct Attack
bGlobal = false; bGlobal = false;
bShowInAttackList = true; bShowInAttackList = true;
} }
Attack() { MakeBlank(); } Attack(): level(ATTACK_LEVEL_1), fStartSecond(-1),
fSecsRemaining(0), sModifiers(RString()),
bOn(false), bGlobal(false), bShowInAttackList(true)
{} // MakeBlank() is effectively called here.
Attack( Attack(
AttackLevel level_, AttackLevel level_,
float fStartSecond_, float fStartSecond_,
@@ -40,16 +43,11 @@ struct Attack
RString sModifiers_, RString sModifiers_,
bool bOn_, bool bOn_,
bool bGlobal_, bool bGlobal_,
bool bShowInAttackList_ = true ) bool bShowInAttackList_ = true ):
{ level(level_), fStartSecond(fStartSecond_),
level = level_; fSecsRemaining(fSecsRemaining_), sModifiers(sModifiers_),
fStartSecond = fStartSecond_; bOn(bOn_), bGlobal(bGlobal_),
fSecsRemaining = fSecsRemaining_; bShowInAttackList(bShowInAttackList_) {}
sModifiers = sModifiers_;
bOn = bOn_;
bGlobal = bGlobal_;
bShowInAttackList = bShowInAttackList_;
}
void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const; void GetAttackBeats( const Song *pSong, float &fStartBeat, float &fEndBeat ) const;
void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const; void GetRealtimeAttackBeats( const Song *pSong, const PlayerState* pPlayerState, float &fStartBeat, float &fEndBeat ) const;
+3 -6
View File
@@ -66,12 +66,9 @@ private:
RageTexture* pTexture_, RageTexture* pTexture_,
float fDelaySecs_, float fDelaySecs_,
RageVector2 vTranslate_ RageVector2 vTranslate_
) ):
{ pTexture(pTexture_), fDelaySecs(fDelaySecs_),
pTexture = pTexture_; vTranslate(vTranslate_) {}
fDelaySecs = fDelaySecs_;
vTranslate = vTranslate_;
}
RageTexture* pTexture; RageTexture* pTexture;
float fDelaySecs; float fDelaySecs;
+1 -1
View File
@@ -7,7 +7,7 @@
struct RageSurfaceColor struct RageSurfaceColor
{ {
uint8_t r, g, b, a; uint8_t r, g, b, a;
RageSurfaceColor() { } RageSurfaceColor(): r(0), g(0), b(0), a(0) { }
RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ): RageSurfaceColor( uint8_t r_, uint8_t g_, uint8_t b_, uint8_t a_ ):
r(r_), g(g_), b(b_), a(a_) { } r(r_), g(g_), b(b_), a(a_) { }
+9 -2
View File
@@ -59,8 +59,15 @@ struct RageTextureID
void Init(); void Init();
RageTextureID() { Init(); } RageTextureID(): filename(RString()), iMaxSize(0), bMipMaps(false),
RageTextureID( const RString &fn ) { Init(); SetFilename(fn); } iAlphaBits(0), iGrayscaleBits(0), iColorDepth(0),
bDither(false), bStretch(false), bHotPinkColorKey(false),
AdditionalTextureHints(RString()), Policy(TEX_DEFAULT) { Init(); }
RageTextureID( const RString &fn ): filename(RString()), iMaxSize(0),
bMipMaps(false), iAlphaBits(0), iGrayscaleBits(0),
iColorDepth(0), bDither(false), bStretch(false),
bHotPinkColorKey(false), AdditionalTextureHints(RString()),
Policy(TEX_DEFAULT) { Init(); SetFilename(fn); }
void SetFilename( const RString &fn ); void SetFilename( const RString &fn );
}; };
+11 -18
View File
@@ -14,30 +14,23 @@ struct RageTextureManagerPrefs
bool m_bHighResolutionTextures; bool m_bHighResolutionTextures;
bool m_bMipMaps; bool m_bMipMaps;
RageTextureManagerPrefs() RageTextureManagerPrefs(): m_iTextureColorDepth(16),
{ m_iMovieColorDepth(16), m_bDelayedDelete(false),
m_bDelayedDelete = false; m_iMaxTextureResolution(1024),
m_iMovieColorDepth = 16; m_bHighResolutionTextures(true), m_bMipMaps(false) {}
m_iTextureColorDepth = 16;
m_iMaxTextureResolution = 1024;
m_bHighResolutionTextures = true;
m_bMipMaps = false;
}
RageTextureManagerPrefs( RageTextureManagerPrefs(
int iTextureColorDepth, int iTextureColorDepth,
int iMovieColorDepth, int iMovieColorDepth,
bool bDelayedDelete, bool bDelayedDelete,
int iMaxTextureResolution, int iMaxTextureResolution,
bool bHighResolutionTextures, bool bHighResolutionTextures,
bool bMipMaps ) bool bMipMaps ):
{ m_iTextureColorDepth(iTextureColorDepth),
m_bDelayedDelete = bDelayedDelete; m_iMovieColorDepth(iMovieColorDepth),
m_iMovieColorDepth = iMovieColorDepth; m_bDelayedDelete(bDelayedDelete),
m_iTextureColorDepth = iTextureColorDepth; m_iMaxTextureResolution(iMaxTextureResolution),
m_iMaxTextureResolution = iMaxTextureResolution; m_bHighResolutionTextures(bHighResolutionTextures),
m_bHighResolutionTextures = bHighResolutionTextures; m_bMipMaps(bMipMaps) {}
m_bMipMaps = bMipMaps;
}
bool operator!=( const RageTextureManagerPrefs& rhs ) const bool operator!=( const RageTextureManagerPrefs& rhs ) const
{ {
+2 -2
View File
@@ -290,8 +290,8 @@ class RageVColor
public: public:
uint8_t b,g,r,a; // specific ordering required by Direct3D uint8_t b,g,r,a; // specific ordering required by Direct3D
RageVColor() { } RageVColor(): b(0), g(0), r(0), a(0) { }
RageVColor(const RageColor &rc) { *this = rc; } RageVColor(const RageColor &rc): b(0), g(0), r(0), a(0) { *this = rc; }
RageVColor &operator= (const RageColor &rc) RageVColor &operator= (const RageColor &rc)
{ {
r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a); r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a);
+3 -5
View File
@@ -17,7 +17,7 @@
RandomGen g_RandomNumberGenerator; RandomGen g_RandomNumberGenerator;
MersenneTwister::MersenneTwister( int iSeed ) MersenneTwister::MersenneTwister( int iSeed ) : m_iNext(0)
{ {
Reset( iSeed ); Reset( iSeed );
} }
@@ -1315,15 +1315,13 @@ void Regex::Release()
m_sPattern = RString(); m_sPattern = RString();
} }
Regex::Regex( const RString &sStr ) Regex::Regex( const RString &sStr ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString())
{ {
m_pReg = NULL;
Set( sStr ); Set( sStr );
} }
Regex::Regex( const Regex &rhs ) Regex::Regex( const Regex &rhs ): m_pReg(NULL), m_iBackrefs(0), m_sPattern(RString())
{ {
m_pReg = NULL;
Set( rhs.m_sPattern ); Set( rhs.m_sPattern );
} }