From 62a0ac137083b78527d3b5d67eb7799655ffede7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 14 Feb 2006 11:16:39 +0000 Subject: [PATCH] spacing --- stepmania/src/Course.cpp | 4 ++-- stepmania/src/DateTime.cpp | 4 ++-- stepmania/src/EnumHelper.h | 2 +- stepmania/src/Font.cpp | 4 ++-- stepmania/src/LifeMeterBar.cpp | 13 +++++------- stepmania/src/RageException.cpp | 10 ++++----- stepmania/src/RageFile.cpp | 4 ++-- stepmania/src/RageFileBasic.cpp | 2 +- stepmania/src/RageLog.cpp | 36 ++++++++++++++++----------------- stepmania/src/StdString.h | 8 ++++---- 10 files changed, 42 insertions(+), 45 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 384a7f85e7..80a4da76ae 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -362,7 +362,7 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c ASSERT( bOK ); } ASSERT_M( trail.m_vEntries.size() == SortTrail.m_vEntries.size(), - ssprintf("%i %i", int(trail.m_vEntries.size()), int(SortTrail.m_vEntries.size())) ); + ssprintf("%i %i", int(trail.m_vEntries.size()), int(SortTrail.m_vEntries.size())) ); vector entries; for( unsigned i = 0; i < trail.m_vEntries.size(); ++i ) @@ -665,7 +665,7 @@ void Course::GetAllTrails( vector &AddTo ) const int Course::GetMeter( StepsType st, CourseDifficulty cd ) const { - if( m_iCustomMeter[cd] != -1 ) + if( m_iCustomMeter[cd] != -1 ) return m_iCustomMeter[cd]; const Trail* pTrail = GetTrail( st ); if( pTrail != NULL ) diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index bb9dacc48d..b88b80aa6f 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -45,7 +45,7 @@ bool DateTime::operator==( const DateTime& other ) const DateTime DateTime::GetNowDateTime() { time_t now = time(NULL); - tm tNow; + tm tNow; localtime_r( &now, &tNow ); DateTime dtNow; #define COPY_M( v ) dtNow.v = tNow.v; @@ -61,7 +61,7 @@ DateTime DateTime::GetNowDateTime() DateTime DateTime::GetNowDate() { - DateTime tNow = GetNowDateTime(); + DateTime tNow = GetNowDateTime(); tNow.StripTime(); return tNow; } diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index 09cdd6d40a..c4790b37b1 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -87,7 +87,7 @@ static const RString EMPTY_STRING; { \ RString s2 = s; \ s2.MakeLower(); \ - unsigned i; \ + unsigned i; \ for( i = 0; i < ARRAYSIZE(X##Names); ++i ) \ if( !s2.CompareNoCase(X##Names[i]) ) \ return (X)i; \ diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index 98d89e09a9..57d994153a 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -309,8 +309,8 @@ bool Font::FontCompleteForString( const wstring &str ) const void Font::CapsOnly() { /* For each uppercase character that we have a mapping for, add - * a lowercase one. */ - for(char c = 'A'; c <= 'Z'; ++c) + * a lowercase one. */ + for( char c = 'A'; c <= 'Z'; ++c ) { map::const_iterator it = m_iCharToGlyph.find(c); diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index ec44dfd196..5f71c5b7e9 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -283,14 +283,10 @@ void LifeMeterBar::AfterLifeChanged() bool LifeMeterBar::IsPastPassmark() const { - if( m_pPlayerState->m_PlayerOptions.m_fPassmark > 0 ) - { + if( m_pPlayerState->m_PlayerOptions.m_fPassmark > 0 ) return m_fLifePercentage >= m_pPlayerState->m_PlayerOptions.m_fPassmark; - } - else - { + else return false; - } } bool LifeMeterBar::IsHot() const @@ -367,7 +363,8 @@ void LifeMeterBar::UpdateNonstopLifebar(const int cleared, if (m_fLifeDifficulty >= 0.4) return; - /* Approximate deductions for a miss + /* + * Approximate deductions for a miss * Life 1 : 5 % * Life 2 : 5.7 % * Life 3 : 6.6 % @@ -389,7 +386,7 @@ void LifeMeterBar::UpdateNonstopLifebar(const int cleared, * a miss, and a W5 would suck up half of your lifebar. * * Everything past 7 is intended mainly for nonstop mode. - */ + */ // the lifebar is pretty harsh at 0.4 already (you lose diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index 802a72bc4b..fc8cf64dce 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -19,12 +19,12 @@ void RageException::SetCleanupHandler( void (*pHandler)(const RString &sError) ) * the same way to code in practice. */ void RageException::Throw(const char *fmt, ...) { - va_list va; - va_start(va, fmt); - RString error = vssprintf( fmt, va ); - va_end(va); + va_list va; + va_start(va, fmt); + RString error = vssprintf( fmt, va ); + va_end(va); - RString msg = ssprintf( + RString msg = ssprintf( "\n" "//////////////////////////////////////////////////////\n" "Exception: %s\n" diff --git a/stepmania/src/RageFile.cpp b/stepmania/src/RageFile.cpp index cf00a6403d..a3ea035a57 100644 --- a/stepmania/src/RageFile.cpp +++ b/stepmania/src/RageFile.cpp @@ -13,7 +13,7 @@ RageFile::RageFile() { - m_File = NULL; + m_File = NULL; } RageFile::RageFile( const RageFile &cpy ): @@ -73,7 +73,7 @@ bool RageFile::Open( const RString& path, int mode ) return false; } - return true; + return true; } void RageFile::Close() diff --git a/stepmania/src/RageFileBasic.cpp b/stepmania/src/RageFileBasic.cpp index ef4094db57..e8d83b15de 100644 --- a/stepmania/src/RageFileBasic.cpp +++ b/stepmania/src/RageFileBasic.cpp @@ -76,7 +76,7 @@ int RageFileObj::Seek( int offset, int whence ) int RageFileObj::Read( void *pBuffer, size_t iBytes ) { - int ret = 0; + int ret = 0; while( !m_bEOF && iBytes > 0 ) { diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index 5b20a0f7c2..aa560af4d2 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -169,8 +169,8 @@ void RageLog::SetShowLogOutput( bool show ) { // create a new console window and attach standard handles AllocConsole(); - freopen("CONOUT$","wb",stdout); - freopen("CONOUT$","wb",stderr); + freopen( "CONOUT$","wb", stdout ); + freopen( "CONOUT$","wb", stderr ); } else { @@ -181,32 +181,32 @@ void RageLog::SetShowLogOutput( bool show ) void RageLog::Trace( const char *fmt, ...) { - va_list va; - va_start(va, fmt); - RString sBuff = vssprintf( fmt, va ); - va_end(va); + va_list va; + va_start( va, fmt ); + RString sBuff = vssprintf( fmt, va ); + va_end( va); - Write(0, sBuff); + Write(0, sBuff ); } /* Use this for more important information; it'll always be included * in crash dumps. */ void RageLog::Info( const char *fmt, ...) { - va_list va; - va_start(va, fmt); - RString sBuff = vssprintf( fmt, va ); - va_end(va); + va_list va; + va_start( va, fmt ); + RString sBuff = vssprintf( fmt, va ); + va_end( va ); - Write(WRITE_TO_INFO, sBuff); + Write( WRITE_TO_INFO, sBuff ); } void RageLog::Warn( const char *fmt, ...) { - va_list va; - va_start(va, fmt); - RString sBuff = vssprintf( fmt, va ); - va_end(va); + va_list va; + va_start(va, fmt); + RString sBuff = vssprintf( fmt, va ); + va_end(va); Write( WRITE_TO_INFO | WRITE_LOUD, sBuff ); } @@ -362,9 +362,9 @@ void RageLog::MapLog(const RString &key, const char *fmt, ...) RString s; va_list va; - va_start(va, fmt); + va_start(va, fmt); s += vssprintf( fmt, va ); - va_end(va); + va_end(va); LogMaps[key] = s; UpdateMappedLog(); diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index 1ebf3a01f8..b48a4f6c0f 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -672,8 +672,8 @@ public: // ------------------------------------------------------------------------- // formatting (using wsprintf style formatting) - // If they want a Format() function that safely handles string objects - // without casting + // If they want a Format() function that safely handles string objects + // without casting void Format(const CT* szFmt, ...) @@ -804,7 +804,7 @@ public: MYTYPE Left(int nCount) const { - // Range check the count. + // Range check the count. nCount = max(0, min(nCount, static_cast(this->size()))); return this->substr(0, static_cast(nCount)); @@ -867,7 +867,7 @@ public: MYTYPE Right(int nCount) const { - // Range check the count. + // Range check the count. nCount = max(0, min(nCount, static_cast(this->size()))); return this->substr(this->size()-static_cast(nCount));