Revert. Fixes Linux build.

This commit is contained in:
Steve Checkoway
2006-07-18 05:51:37 +00:00
parent 61739160fe
commit a07e194cf1
31 changed files with 86 additions and 86 deletions
+1 -1
View File
@@ -1139,7 +1139,7 @@ bool Actor::TweenState::operator==( const TweenState &other ) const
COMPARE( fSkewX ); COMPARE( fSkewX );
COMPARE( crop ); COMPARE( crop );
COMPARE( fade ); COMPARE( fade );
for( unsigned i=0; i<ARRAY_SIZE(diffuse); i++ ) for( unsigned i=0; i<ARRAYSIZE(diffuse); i++ )
COMPARE( diffuse[i] ); COMPARE( diffuse[i] );
COMPARE( glow ); COMPARE( glow );
COMPARE( aux ); COMPARE( aux );
+2 -2
View File
@@ -61,7 +61,7 @@ static const RString EMPTY_STRING;
as_##X##Name[i] = ap; \ as_##X##Name[i] = ap; \
} \ } \
} \ } \
ASSERT( CNT == ARRAY_SIZE(X##Names) ); \ ASSERT( CNT == ARRAYSIZE(X##Names) ); \
if( x == CNT+1 ) \ if( x == CNT+1 ) \
return EMPTY_STRING; \ return EMPTY_STRING; \
ASSERT( x < CNT ); \ ASSERT( x < CNT ); \
@@ -88,7 +88,7 @@ static const RString EMPTY_STRING;
RString s2 = s; \ RString s2 = s; \
s2.MakeLower(); \ s2.MakeLower(); \
unsigned i; \ unsigned i; \
for( i = 0; i < ARRAY_SIZE(X##Names); ++i ) \ for( i = 0; i < ARRAYSIZE(X##Names); ++i ) \
if( !s2.CompareNoCase(X##Names[i]) ) \ if( !s2.CompareNoCase(X##Names[i]) ) \
return (X)i; \ return (X)i; \
return (X)(i+1); /*invalid*/ \ return (X)(i+1); /*invalid*/ \
+2 -2
View File
@@ -275,7 +275,7 @@ const glyph &Font::GetGlyph( wchar_t c ) const
ASSERT(c >= 0 && c <= 0xFFFFFF); ASSERT(c >= 0 && c <= 0xFFFFFF);
/* Fast path: */ /* Fast path: */
if( c < (int) ARRAY_SIZE(m_iCharToGlyphCache) && m_iCharToGlyphCache[c] ) if( c < (int) ARRAYSIZE(m_iCharToGlyphCache) && m_iCharToGlyphCache[c] )
return *m_iCharToGlyphCache[c]; return *m_iCharToGlyphCache[c];
/* Try the regular character. */ /* Try the regular character. */
@@ -767,7 +767,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
ZERO( m_iCharToGlyphCache ); ZERO( m_iCharToGlyphCache );
map<longchar,glyph*>::iterator it; map<longchar,glyph*>::iterator it;
for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it ) for( it = m_iCharToGlyph.begin(); it != m_iCharToGlyph.end(); ++it )
if( it->first < (int) ARRAY_SIZE(m_iCharToGlyphCache) ) if( it->first < (int) ARRAYSIZE(m_iCharToGlyphCache) )
m_iCharToGlyphCache[it->first] = it->second; m_iCharToGlyphCache[it->first] = it->second;
} }
} }
+1 -1
View File
@@ -2636,7 +2636,7 @@ static Style g_Styles[] =
}, },
}; };
#define NUM_STYLES ARRAY_SIZE(g_Styles) #define NUM_STYLES ARRAYSIZE(g_Styles)
GameManager::GameManager() GameManager::GameManager()
+2 -2
View File
@@ -130,7 +130,7 @@ public:
Actor::SetTextureRenderStates(); Actor::SetTextureRenderStates();
DISPLAY->SetTextureModeModulate(); DISPLAY->SetTextureModeModulate();
DISPLAY->DrawQuadStrip( m_Slices, ARRAY_SIZE(m_Slices) ); DISPLAY->DrawQuadStrip( m_Slices, ARRAYSIZE(m_Slices) );
} }
RageSpriteVertex m_Slices[2*VALUE_RESOLUTION]; RageSpriteVertex m_Slices[2*VALUE_RESOLUTION];
@@ -192,7 +192,7 @@ void GraphDisplay::LoadFromStageStats( const StageStats &ss, const PlayerStageSt
m_Values.resize( VALUE_RESOLUTION ); m_Values.resize( VALUE_RESOLUTION );
pss.GetLifeRecord( &m_Values[0], VALUE_RESOLUTION, ss.GetTotalPossibleStepsSeconds() ); pss.GetLifeRecord( &m_Values[0], VALUE_RESOLUTION, ss.GetTotalPossibleStepsSeconds() );
for( unsigned i=0; i<ARRAY_SIZE(m_Values); i++ ) for( unsigned i=0; i<ARRAYSIZE(m_Values); i++ )
CLAMP( m_Values[i], 0.f, 1.f ); CLAMP( m_Values[i], 0.f, 1.f );
// //
+1 -1
View File
@@ -504,7 +504,7 @@ void InputMapper::AutoMapJoysticksForCurrentGame()
{ {
InputDevice id = vDevices[i].id; InputDevice id = vDevices[i].id;
const RString &sDescription = vDevices[i].sDesc; const RString &sDescription = vDevices[i].sDesc;
for( unsigned j=0; j<ARRAY_SIZE(g_AutoJoyMappings); j++ ) for( unsigned j=0; j<ARRAYSIZE(g_AutoJoyMappings); j++ )
{ {
const AutoJoyMapping& mapping = g_AutoJoyMappings[j]; const AutoJoyMapping& mapping = g_AutoJoyMappings[j];
+2 -2
View File
@@ -198,7 +198,7 @@ static int g_iNumStackCounts = 0;
Lua *LuaManager::Get() Lua *LuaManager::Get()
{ {
m_pLock->Lock(); m_pLock->Lock();
if( size_t(g_iNumStackCounts) < ARRAY_SIZE(g_iStackCounts) ) if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) )
{ {
g_iStackCounts[g_iNumStackCounts] = lua_gettop(L); g_iStackCounts[g_iNumStackCounts] = lua_gettop(L);
} }
@@ -211,7 +211,7 @@ void LuaManager::Release( Lua *&p )
ASSERT( p == L ); ASSERT( p == L );
ASSERT( g_iNumStackCounts != 0 ); ASSERT( g_iNumStackCounts != 0 );
--g_iNumStackCounts; --g_iNumStackCounts;
if( size_t(g_iNumStackCounts) < ARRAY_SIZE(g_iStackCounts) ) if( size_t(g_iNumStackCounts) < ARRAYSIZE(g_iStackCounts) )
{ {
ASSERT( g_iStackCounts[g_iNumStackCounts] == lua_gettop(L) ); ASSERT( g_iStackCounts[g_iNumStackCounts] == lua_gettop(L) );
} }
+1 -1
View File
@@ -45,7 +45,7 @@ static const SortOrder g_SongSortOrders[] =
SORT_ARTIST, SORT_ARTIST,
SORT_GENRE, SORT_GENRE,
}; };
const vector<SortOrder> SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAY_SIZE(g_SongSortOrders) ); const vector<SortOrder> SONG_SORT_ORDERS( g_SongSortOrders, g_SongSortOrders + ARRAYSIZE(g_SongSortOrders) );
MusicWheel::MusicWheel() MusicWheel::MusicWheel()
{ {
+2 -2
View File
@@ -1823,7 +1823,7 @@ const ValidRow g_ValidRows[] =
void NoteDataUtil::RemoveStretch( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex ) void NoteDataUtil::RemoveStretch( NoteData &inout, StepsType st, int iStartIndex, int iEndIndex )
{ {
vector<const ValidRow*> vpValidRowsToCheck; vector<const ValidRow*> vpValidRowsToCheck;
for( unsigned i=0; i<ARRAY_SIZE(g_ValidRows); i++ ) for( unsigned i=0; i<ARRAYSIZE(g_ValidRows); i++ )
{ {
if( g_ValidRows[i].st == st ) if( g_ValidRows[i].st == st )
vpValidRowsToCheck.push_back( &g_ValidRows[i] ); vpValidRowsToCheck.push_back( &g_ValidRows[i] );
@@ -1961,7 +1961,7 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong )
TapNote::attack, TapNote::attack,
TapNote::SubType_invalid, TapNote::SubType_invalid,
TapNote::original, TapNote::original,
szAttacks[RandomInt(ARRAY_SIZE(szAttacks))], szAttacks[RandomInt(ARRAYSIZE(szAttacks))],
15.0f, 15.0f,
false, false,
0 ); 0 );
+1 -1
View File
@@ -20,7 +20,7 @@ void NotesLoader::GetMainAndSubTitlesFromFullTitle( const RString &sFullTitle, R
{ {
const RString sLeftSeps[] = { " -", " ~", " (", " [", "\t" }; const RString sLeftSeps[] = { " -", " ~", " (", " [", "\t" };
for( unsigned i=0; i<ARRAY_SIZE(sLeftSeps); i++ ) for( unsigned i=0; i<ARRAYSIZE(sLeftSeps); i++ )
{ {
size_t iBeginIndex = sFullTitle.find( sLeftSeps[i] ); size_t iBeginIndex = sFullTitle.find( sLeftSeps[i] );
if( iBeginIndex == string::npos ) if( iBeginIndex == string::npos )
+1 -1
View File
@@ -809,7 +809,7 @@ void BMSLoader::SetTimeSigAdjustments( const MeasureToTimeSig_t &sigs, Song *pOu
}; };
bool bValidTimeSignature = false; bool bValidTimeSignature = false;
for( unsigned i = 0; i < ARRAY_SIZE(ValidFactors); ++i ) for( unsigned i = 0; i < ARRAYSIZE(ValidFactors); ++i )
if( fabsf(fFactor-ValidFactors[i]) < 0.001 ) if( fabsf(fFactor-ValidFactors[i]) < 0.001 )
bValidTimeSignature = true; bValidTimeSignature = true;
+1 -1
View File
@@ -54,7 +54,7 @@ void OptionIcon::Set( PlayerNumber pn, const RString &_sText, bool bHeader )
"OFF", "OFF",
}; };
for( unsigned i=0; i<ARRAY_SIZE(sStopWords); i++ ) for( unsigned i=0; i<ARRAYSIZE(sStopWords); i++ )
if( 0==stricmp(sText,sStopWords[i]) ) if( 0==stricmp(sText,sStopWords[i]) )
sText = ""; sText = "";
+1 -1
View File
@@ -84,7 +84,7 @@ int OptionToPreferredColumn( RString sOptionText )
return 0; return 0;
} }
for( unsigned i=0; i<ARRAY_SIZE(g_OptionColumnEntries); i++ ) for( unsigned i=0; i<ARRAYSIZE(g_OptionColumnEntries); i++ )
if( g_OptionColumnEntries[i].szString == sOptionText ) if( g_OptionColumnEntries[i].szString == sOptionText )
return g_OptionColumnEntries[i].iSlotIndex; return g_OptionColumnEntries[i].iSlotIndex;
+1 -1
View File
@@ -14,7 +14,7 @@
#include "arch/Dialog/Dialog.h" #include "arch/Dialog/Dialog.h"
#include <float.h> #include <float.h>
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAY_SIZE(arr); ++Z ) arr[Z]=1.0f; } #define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; }
void PlayerOptions::Init() void PlayerOptions::Init()
{ {
+1 -1
View File
@@ -702,7 +702,7 @@ static bool PathUsesSlowFlush( const RString &sPath )
"Save/" "Save/"
}; };
for( unsigned i = 0; i < ARRAY_SIZE(FlushPaths); ++i ) for( unsigned i = 0; i < ARRAYSIZE(FlushPaths); ++i )
if( !strncmp( sPath, FlushPaths[i], strlen(FlushPaths[i]) ) ) if( !strncmp( sPath, FlushPaths[i], strlen(FlushPaths[i]) ) )
return true; return true;
return false; return false;
+10 -10
View File
@@ -600,9 +600,9 @@ float RageFastSin( float x )
if( !bInited ) if( !bInited )
{ {
bInited = true; bInited = true;
for( unsigned i=0; i<ARRAY_SIZE(table); i++ ) for( unsigned i=0; i<ARRAYSIZE(table); i++ )
{ {
float x = SCALE(i,0,ARRAY_SIZE(table),0.0f,PI); float x = SCALE(i,0,ARRAYSIZE(table),0.0f,PI);
table[i] = sinf(x); table[i] = sinf(x);
} }
} }
@@ -611,7 +611,7 @@ float RageFastSin( float x )
if( x == 0 ) if( x == 0 )
return 0; return 0;
float fIndex = SCALE( x, 0.0f, PI*2, 0, ARRAY_SIZE(table)*2 ); float fIndex = SCALE( x, 0.0f, PI*2, 0, ARRAYSIZE(table)*2 );
// lerp using samples from the table // lerp using samples from the table
int iSampleIndex[2]; int iSampleIndex[2];
@@ -619,22 +619,22 @@ float RageFastSin( float x )
iSampleIndex[1] = iSampleIndex[0]+1; iSampleIndex[1] = iSampleIndex[0]+1;
float fRemainder = fIndex - iSampleIndex[0]; float fRemainder = fIndex - iSampleIndex[0];
for( unsigned i=0; i<ARRAY_SIZE(iSampleIndex); i++ ) for( unsigned i=0; i<ARRAYSIZE(iSampleIndex); i++ )
iSampleIndex[i] %= ARRAY_SIZE(table) * 2; iSampleIndex[i] %= ARRAYSIZE(table) * 2;
DEBUG_ASSERT( fRemainder>=0 && fRemainder<=1 ); DEBUG_ASSERT( fRemainder>=0 && fRemainder<=1 );
float fValue[ARRAY_SIZE(iSampleIndex)]; float fValue[ARRAYSIZE(iSampleIndex)];
for( unsigned i=0; i<ARRAY_SIZE(iSampleIndex); i++ ) for( unsigned i=0; i<ARRAYSIZE(iSampleIndex); i++ )
{ {
int &iSample = iSampleIndex[i]; int &iSample = iSampleIndex[i];
float &fVal = fValue[i]; float &fVal = fValue[i];
if( iSample >= int(ARRAY_SIZE(table)) ) // PI <= iSample < 2*PI if( iSample >= int(ARRAYSIZE(table)) ) // PI <= iSample < 2*PI
{ {
// sin(x) == -sin(PI+x) // sin(x) == -sin(PI+x)
iSample -= ARRAY_SIZE(table); iSample -= ARRAYSIZE(table);
DEBUG_ASSERT( iSample>=0 && iSample<int(ARRAY_SIZE(table)) ); DEBUG_ASSERT( iSample>=0 && iSample<int(ARRAYSIZE(table)) );
fVal = -table[iSample]; fVal = -table[iSample];
} }
else else
+1 -1
View File
@@ -275,7 +275,7 @@ int RageSoundReader_Chain::ReadBlock( int16_t *pBuffer, int iFrames )
{ {
ActiveSound &s = m_apActiveSounds[i]; ActiveSound &s = m_apActiveSounds[i];
SoundReader *pSound = s.pSound; SoundReader *pSound = s.pSound;
int iSamples = min( iFramesToRead * pSound->GetNumChannels(), ARRAY_SIZE(Buffer) ); int iSamples = min( iFramesToRead * pSound->GetNumChannels(), ARRAYSIZE(Buffer) );
int iBytesRead = pSound->Read( (char *) Buffer, iSamples*sizeof(int16_t) ); int iBytesRead = pSound->Read( (char *) Buffer, iSamples*sizeof(int16_t) );
if( iBytesRead == -1 || iBytesRead == 0 ) if( iBytesRead == -1 || iBytesRead == 0 )
{ {
+2 -2
View File
@@ -504,7 +504,7 @@ static const LanguageInfo g_langs[] =
void GetLanguageInfos( vector<const LanguageInfo*> &vAddTo ) void GetLanguageInfos( vector<const LanguageInfo*> &vAddTo )
{ {
for( unsigned i=0; i<ARRAY_SIZE(g_langs); ++i ) for( unsigned i=0; i<ARRAYSIZE(g_langs); ++i )
{ {
// Only use languages in the intersection of Windows languages // Only use languages in the intersection of Windows languages
// and languages that had native forms on the site listed above. // and languages that had native forms on the site listed above.
@@ -518,7 +518,7 @@ void GetLanguageInfos( vector<const LanguageInfo*> &vAddTo )
const LanguageInfo *GetLanguageInfo( const RString &sIsoCode ) const LanguageInfo *GetLanguageInfo( const RString &sIsoCode )
{ {
for( unsigned i=0; i<ARRAY_SIZE(g_langs); ++i ) for( unsigned i=0; i<ARRAYSIZE(g_langs); ++i )
{ {
// Only use languages in the intersection of Windows languages // Only use languages in the intersection of Windows languages
// and languages that had native forms on the site listed above. // and languages that had native forms on the site listed above.
+1 -1
View File
@@ -14,7 +14,7 @@ class RageFileDriver;
#define ZERO(x) memset(&(x), 0, sizeof(x)) #define ZERO(x) memset(&(x), 0, sizeof(x))
#define COPY(a,b) do { ASSERT(sizeof(a)==sizeof(b)); memcpy(&(a), &(b), sizeof(a)); } while( false ) #define COPY(a,b) do { ASSERT(sizeof(a)==sizeof(b)); memcpy(&(a), &(b), sizeof(a)); } while( false )
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #define ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
/* Common harmless mismatches. All min(T,T) and max(T,T) cases are handled /* Common harmless mismatches. All min(T,T) and max(T,T) cases are handled
* by the generic template we get from <algorithm>. */ * by the generic template we get from <algorithm>. */
+3 -3
View File
@@ -1211,7 +1211,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
const float fSpeeds[] = { 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f, 8.0f }; const float fSpeeds[] = { 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f, 8.0f };
int iSpeed = 0; int iSpeed = 0;
for( unsigned i = 0; i < ARRAY_SIZE(fSpeeds); ++i ) for( unsigned i = 0; i < ARRAYSIZE(fSpeeds); ++i )
{ {
if( fSpeeds[i] == fScrollSpeed ) if( fSpeeds[i] == fScrollSpeed )
{ {
@@ -1224,7 +1224,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
--iSpeed; --iSpeed;
else if( EditB == EDIT_BUTTON_SCROLL_SPEED_UP ) else if( EditB == EDIT_BUTTON_SCROLL_SPEED_UP )
++iSpeed; ++iSpeed;
iSpeed = clamp( iSpeed, 0, (int) ARRAY_SIZE(fSpeeds)-1 ); iSpeed = clamp( iSpeed, 0, (int) ARRAYSIZE(fSpeeds)-1 );
if( fSpeeds[iSpeed] != fScrollSpeed ) if( fSpeeds[iSpeed] != fScrollSpeed )
{ {
@@ -3608,7 +3608,7 @@ void ScreenEdit::DoHelp()
{ {
g_EditHelp.rows.clear(); g_EditHelp.rows.clear();
for( unsigned i=0; i<ARRAY_SIZE(g_EditHelpLines); ++i ) for( unsigned i=0; i<ARRAYSIZE(g_EditHelpLines); ++i )
{ {
const EditHelpLine &hl = g_EditHelpLines[i]; const EditHelpLine &hl = g_EditHelpLines[i];
+1 -1
View File
@@ -215,7 +215,7 @@ void ScreenEvaluation::Init()
{ {
const int ScoreBonuses[] = { 10000000, 10000000, 1000000, 100000, 10000, 1000, 100 }; const int ScoreBonuses[] = { 10000000, 10000000, 1000000, 100000, 10000, 1000, 100 };
Grade g = STATSMAN->m_CurStageStats.m_player[p].GetGrade(); Grade g = STATSMAN->m_CurStageStats.m_player[p].GetGrade();
if( g < (int) ARRAY_SIZE(ScoreBonuses) ) if( g < (int) ARRAYSIZE(ScoreBonuses) )
{ {
STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g]; STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g];
STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g]; STATSMAN->m_CurStageStats.m_player[p].iBonus += ScoreBonuses[(int)g];
+1 -1
View File
@@ -57,7 +57,7 @@ const char NAME_CHARS[] =
{ {
' ',' ',' ',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' ' ',' ',' ',' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
}; };
#define NUM_NAME_CHARS (ARRAY_SIZE(NAME_CHARS)) #define NUM_NAME_CHARS (ARRAYSIZE(NAME_CHARS))
#define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY) #define HEIGHT_OF_ALL_CHARS (NUM_NAME_CHARS * g_fCharsSpacingY)
+27 -27
View File
@@ -295,7 +295,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption
static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption ) static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::MusicWheelUsesSections mapping[] = { PrefsManager::NEVER, PrefsManager::ALWAYS, PrefsManager::ABC_ONLY }; const PrefsManager::MusicWheelUsesSections mapping[] = { PrefsManager::NEVER, PrefsManager::ALWAYS, PrefsManager::ABC_ONLY };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Background options */ /* Background options */
@@ -303,19 +303,19 @@ static void WheelSections( int &sel, bool ToSel, const ConfOption *pConfOption )
static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption ) static void BGBrightness( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void BGBrightnessNoZero( int &sel, bool ToSel, const ConfOption *pConfOption ) static void BGBrightnessNoZero( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; const float mapping[] = { 0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void BGBrightnessOrStatic( int &sel, bool ToSel, const ConfOption *pConfOption ) static void BGBrightnessOrStatic( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.5f,0.25f,0.5f,0.75f }; const float mapping[] = { 0.5f,0.25f,0.5f,0.75f };
MoveMap( sel, PREFSMAN->m_fBGBrightness, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fBGBrightness, ToSel, mapping, ARRAYSIZE(mapping) );
if( ToSel && !PREFSMAN->m_bSongBackgrounds ) if( ToSel && !PREFSMAN->m_bSongBackgrounds )
sel = 0; sel = 0;
@@ -326,57 +326,57 @@ static void BGBrightnessOrStatic( int &sel, bool ToSel, const ConfOption *pConfO
static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption ) static void NumBackgrounds( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 5,10,15,20 }; const int mapping[] = { 5,10,15,20 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Input options */ /* Input options */
static void MusicWheelSwitchSpeed( int &sel, bool ToSel, const ConfOption *pConfOption ) static void MusicWheelSwitchSpeed( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 5, 10, 15, 25 }; const int mapping[] = { 5, 10, 15, 25 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Gameplay options */ /* Gameplay options */
static void AllowW1( int &sel, bool ToSel, const ConfOption *pConfOption ) static void AllowW1( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::AllowW1 mapping[] = { PrefsManager::ALLOW_W1_NEVER, PrefsManager::ALLOW_W1_COURSES_ONLY, PrefsManager::ALLOW_W1_EVERYWHERE }; const PrefsManager::AllowW1 mapping[] = { PrefsManager::ALLOW_W1_NEVER, PrefsManager::ALLOW_W1_COURSES_ONLY, PrefsManager::ALLOW_W1_EVERYWHERE };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption ) static void CoinModeM( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const CoinMode mapping[] = { COIN_MODE_HOME, COIN_MODE_PAY, COIN_MODE_FREE }; const CoinMode mapping[] = { COIN_MODE_HOME, COIN_MODE_PAY, COIN_MODE_FREE };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption ) static void CoinModeNoHome( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const CoinMode mapping[] = { COIN_MODE_PAY, COIN_MODE_FREE }; const CoinMode mapping[] = { COIN_MODE_PAY, COIN_MODE_FREE };
MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, PREFSMAN->m_CoinMode, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption ) static void CoinsPerCredit( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }; const int mapping[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void PremiumM( int &sel, bool ToSel, const ConfOption *pConfOption ) static void PremiumM( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const Premium mapping[] = { PREMIUM_NONE, PREMIUM_DOUBLE, PREMIUM_JOINT }; const Premium mapping[] = { PREMIUM_NONE, PREMIUM_DOUBLE, PREMIUM_JOINT };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption ) static void SongsPerPlay( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2,3,4,5 }; const int mapping[] = { 1,2,3,4,5 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pConfOption ) static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 1,2,3,4,5,6 }; const int mapping[] = { 1,2,3,4,5,6 };
MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, PREFSMAN->m_iSongsPerPlay, ToSel, mapping, ARRAYSIZE(mapping) );
if( ToSel && PREFSMAN->m_bEventMode ) if( ToSel && PREFSMAN->m_bEventMode )
sel = 5; sel = 5;
@@ -389,13 +389,13 @@ static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pCo
static void TimingWindowScale( int &sel, bool ToSel, const ConfOption *pConfOption ) static void TimingWindowScale( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f }; const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f }; const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f };
MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static int GetLifeDifficulty() static int GetLifeDifficulty()
@@ -411,13 +411,13 @@ LuaFunction( GetLifeDifficulty, GetLifeDifficulty() );
static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption ) static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK }; const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void GetRankingName( int &sel, bool ToSel, const ConfOption *pConfOption ) static void GetRankingName( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST }; const PrefsManager::GetRankingName mapping[] = { PrefsManager::RANKING_OFF, PrefsManager::RANKING_ON, PrefsManager::RANKING_LIST };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption ) static void DefaultFailType( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -494,37 +494,37 @@ static void DisplayResolutionM( int &sel, bool ToSel, const ConfOption *pConfOpt
static void DisplayColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) static void DisplayColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void MaxTextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption ) static void MaxTextureResolution( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 256,512,1024,2048 }; const int mapping[] = { 256,512,1024,2048 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void TextureColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) static void TextureColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void MovieColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption ) static void MovieColorDepth( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { 16,32 }; const int mapping[] = { 16,32 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption ) static void RefreshRate( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 }; const int mapping[] = { (int) REFRESH_DEFAULT,60,70,72,75,80,85,90,100,120,150 };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void DisplayAspectRatio( int &sel, bool ToSel, const ConfOption *pConfOption ) static void DisplayAspectRatio( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 3/4.f,1,4/3.0f,16/10.0f,16/9.f, 8/3.f }; const float mapping[] = { 3/4.f,1,4/3.0f,16/10.0f,16/9.f, 8/3.f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Simpler DisplayAspectRatio setting, which only offers "on" and "off". "On" can be 16:9 /* Simpler DisplayAspectRatio setting, which only offers "on" and "off". "On" can be 16:9
@@ -535,7 +535,7 @@ static void WideScreen16_10( int &sel, bool ToSel, const ConfOption *pConfOption
ASSERT_M( pPref != NULL, pConfOption->name ); ASSERT_M( pPref != NULL, pConfOption->name );
const float mapping[] = { 4/3.0f, 16/10.0f }; const float mapping[] = { 4/3.0f, 16/10.0f };
MoveMap( sel, *pPref, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, *pPref, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption ) static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -544,7 +544,7 @@ static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption
ASSERT_M( pPref != NULL, pConfOption->name ); ASSERT_M( pPref != NULL, pConfOption->name );
const float mapping[] = { 4/3.0f, 16/9.0f }; const float mapping[] = { 4/3.0f, 16/9.0f };
MoveMap( sel, *pPref, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, *pPref, ToSel, mapping, ARRAYSIZE(mapping) );
} }
/* Sound options */ /* Sound options */
@@ -552,7 +552,7 @@ static void WideScreen16_9( int &sel, bool ToSel, const ConfOption *pConfOption
static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption ) static void SoundVolume( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOption ) static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOption )
@@ -561,7 +561,7 @@ static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOp
for( int i = 0; i < 41; ++i ) for( int i = 0; i < 41; ++i )
mapping[i] = SCALE( i, 0.0f, 40.0f, -0.1f, +0.1f ); mapping[i] = SCALE( i, 0.0f, 40.0f, -0.1f, +0.1f );
MoveMap( sel, pConfOption, ToSel, mapping, ARRAY_SIZE(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYSIZE(mapping) );
} }
static vector<ConfOption> g_ConfOptions; static vector<ConfOption> g_ConfOptions;
+1 -1
View File
@@ -609,7 +609,7 @@ bool CheckVideoDefaultSettings()
VideoCardDefaults defaults; VideoCardDefaults defaults;
for( unsigned i=0; i<ARRAY_SIZE(g_VideoCardDefaults); i++ ) for( unsigned i=0; i<ARRAYSIZE(g_VideoCardDefaults); i++ )
{ {
defaults = g_VideoCardDefaults[i]; defaults = g_VideoCardDefaults[i];
+1 -1
View File
@@ -49,7 +49,7 @@ static void InitEntities()
{ '>', "gt", } { '>', "gt", }
}; };
for( unsigned i = 0; i < ARRAY_SIZE(EntityTable); ++i ) for( unsigned i = 0; i < ARRAYSIZE(EntityTable); ++i )
{ {
const Entity &ent = EntityTable[i]; const Entity &ent = EntityTable[i];
g_mapEntitiesToChars[ent.pEntity] = RString(1, ent.c); g_mapEntitiesToChars[ent.pEntity] = RString(1, ent.c);
@@ -50,7 +50,7 @@ static const DeviceButton g_keys[] =
static DeviceButton GetRandomKeyboardKey() static DeviceButton GetRandomKeyboardKey()
{ {
int index = RandomInt( ARRAY_SIZE(g_keys) ); int index = RandomInt( ARRAYSIZE(g_keys) );
return g_keys[index]; return g_keys[index];
} }
@@ -55,7 +55,7 @@ void InputHandler_Win32_Pump::HandleInput( int iDevice, int iEvent )
InputDevice id = InputDevice( DEVICE_PUMP1 + iDevice ); InputDevice id = InputDevice( DEVICE_PUMP1 + iDevice );
for( int iButton = 0; iButton < ARRAY_SIZE(bits); ++iButton ) for( int iButton = 0; iButton < ARRAYSIZE(bits); ++iButton )
{ {
DeviceInput di( id, enum_add2(JOY_BUTTON_1, iButton) ); DeviceInput di( id, enum_add2(JOY_BUTTON_1, iButton) );
@@ -63,7 +63,7 @@ void RageSound_Generic_Software::Mix( int16_t *buf, int frames, int64_t frameno,
static RageSoundMixBuffer mix; static RageSoundMixBuffer mix;
for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i )
{ {
/* s.snd can not safely be accessed from here. */ /* s.snd can not safely be accessed from here. */
sound &s = sounds[i]; sound &s = sounds[i];
@@ -174,7 +174,7 @@ void RageSound_Generic_Software::DecodeThread()
LockMut( m_Mutex ); LockMut( m_Mutex );
// LOG->Trace("begin mix"); // LOG->Trace("begin mix");
for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i )
{ {
/* The volume can change while the sound is playing; update it. */ /* The volume can change while the sound is playing; update it. */
/* XXX: We can't access snd when in STOPPING; it doesn't exist anymore. */ /* XXX: We can't access snd when in STOPPING; it doesn't exist anymore. */
@@ -195,7 +195,7 @@ void RageSound_Generic_Software::DecodeThread()
* causing major CPU bursts when the stream starts or underruns. (Filling 32k * causing major CPU bursts when the stream starts or underruns. (Filling 32k
* takes more CPU than filling 4k frames, and may cause a gameplay skip.) * takes more CPU than filling 4k frames, and may cause a gameplay skip.)
*/ */
for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i )
{ {
if( sounds[i].state != sound::PLAYING ) if( sounds[i].state != sound::PLAYING )
continue; continue;
@@ -245,7 +245,7 @@ int RageSound_Generic_Software::GetDataForSound( sound &s )
ASSERT( psize[0] > 0 ); ASSERT( psize[0] > 0 );
sound_block *b = p[0]; sound_block *b = p[0];
int size = ARRAY_SIZE(b->buf)/channels; int size = ARRAYSIZE(b->buf)/channels;
bool eof = !s.snd->GetDataToPlay( b->buf, size, b->position, b->frames_in_buffer ); bool eof = !s.snd->GetDataToPlay( b->buf, size, b->position, b->frames_in_buffer );
b->p = b->buf; b->p = b->buf;
@@ -263,7 +263,7 @@ void RageSound_Generic_Software::Update(float delta)
/* We must not lock here, since the decoder thread might hold the lock for a /* We must not lock here, since the decoder thread might hold the lock for a
* while at a time. This is threadsafe, because once a sound is in STOPPING, * while at a time. This is threadsafe, because once a sound is in STOPPING,
* this is the only place it'll be changed (to STOPPED). */ * this is the only place it'll be changed (to STOPPED). */
for( unsigned i = 0; i < ARRAY_SIZE(sounds); ++i ) for( unsigned i = 0; i < ARRAYSIZE(sounds); ++i )
{ {
switch( sounds[i].state ) switch( sounds[i].state )
{ {
@@ -316,10 +316,10 @@ void RageSound_Generic_Software::StartMixing( RageSoundBase *snd )
m_SoundListMutex.Lock(); m_SoundListMutex.Lock();
unsigned i; unsigned i;
for( i = 0; i < ARRAY_SIZE(sounds); ++i ) for( i = 0; i < ARRAYSIZE(sounds); ++i )
if( sounds[i].state == sound::AVAILABLE ) if( sounds[i].state == sound::AVAILABLE )
break; break;
if( i == ARRAY_SIZE(sounds) ) if( i == ARRAYSIZE(sounds) )
{ {
m_SoundListMutex.Unlock(); m_SoundListMutex.Unlock();
return; return;
@@ -381,10 +381,10 @@ void RageSound_Generic_Software::StopMixing( RageSoundBase *snd )
/* Find the sound. */ /* Find the sound. */
unsigned i; unsigned i;
for( i = 0; i < ARRAY_SIZE(sounds); ++i ) for( i = 0; i < ARRAYSIZE(sounds); ++i )
if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd ) if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd )
break; break;
if( i == ARRAY_SIZE(sounds) ) if( i == ARRAYSIZE(sounds) )
{ {
LOG->Trace( "not stopping a sound because it's not playing" ); LOG->Trace( "not stopping a sound because it's not playing" );
return; return;
@@ -416,14 +416,14 @@ bool RageSound_Generic_Software::PauseMixing( RageSoundBase *snd, bool bStop )
/* Find the sound. */ /* Find the sound. */
unsigned i; unsigned i;
for( i = 0; i < ARRAY_SIZE(sounds); ++i ) for( i = 0; i < ARRAYSIZE(sounds); ++i )
if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd ) if( sounds[i].state != sound::AVAILABLE && sounds[i].snd == snd )
break; break;
/* A sound can be paused in PLAYING or STOPPING. (STOPPING means the sound /* A sound can be paused in PLAYING or STOPPING. (STOPPING means the sound
* has been decoded to the end, and we're waiting for that data to finish, so * has been decoded to the end, and we're waiting for that data to finish, so
* externally it looks and acts like PLAYING.) */ * externally it looks and acts like PLAYING.) */
if( i == ARRAY_SIZE(sounds) || if( i == ARRAYSIZE(sounds) ||
(sounds[i].state != sound::PLAYING && sounds[i].state != sound::STOPPING) ) (sounds[i].state != sound::PLAYING && sounds[i].state != sound::STOPPING) )
{ {
LOG->Trace( "not pausing a sound because it's not playing" ); LOG->Trace( "not pausing a sound because it's not playing" );
@@ -117,7 +117,7 @@ namespace VDDebugInfo
pctx->sRawBlock = RString(); pctx->sRawBlock = RString();
pctx->pRVAHeap = NULL; pctx->pRVAHeap = NULL;
GetVDIPath( pctx->sFilename, ARRAY_SIZE(pctx->sFilename) ); GetVDIPath( pctx->sFilename, ARRAYSIZE(pctx->sFilename) );
pctx->sError = RString(); pctx->sError = RString();
HANDLE h = CreateFile( pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); HANDLE h = CreateFile( pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+2 -2
View File
@@ -62,7 +62,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg )
RString sGroup; RString sGroup;
{ {
::GetWindowText( hdlg, szTemp, ARRAY_SIZE(szTemp) ); ::GetWindowText( hdlg, szTemp, ARRAYSIZE(szTemp) );
RString s = szTemp; RString s = szTemp;
sGroup = "Dialog-"+s; sGroup = "Dialog-"+s;
s = THEME->GetString( sGroup, s ); s = THEME->GetString( sGroup, s );
@@ -71,7 +71,7 @@ void DialogUtil::LocalizeDialogAndContents( HWND hdlg )
for( HWND hwndChild = ::GetTopWindow(hdlg); hwndChild != NULL; hwndChild = ::GetNextWindow(hwndChild,GW_HWNDNEXT) ) for( HWND hwndChild = ::GetTopWindow(hdlg); hwndChild != NULL; hwndChild = ::GetNextWindow(hwndChild,GW_HWNDNEXT) )
{ {
::GetWindowText( hwndChild, szTemp, ARRAY_SIZE(szTemp) ); ::GetWindowText( hwndChild, szTemp, ARRAYSIZE(szTemp) );
RString s = szTemp; RString s = szTemp;
if( s.empty() ) if( s.empty() )
continue; continue;
+2 -2
View File
@@ -122,7 +122,7 @@ static Bignum rsa_privkey_op(Bignum input, const RSAKey *key)
SHA512_State ss; SHA512_State ss;
unsigned char digest512[64]; unsigned char digest512[64];
unsigned digestused = ARRAY_SIZE(digest512); unsigned digestused = ARRAYSIZE(digest512);
int hashseq = 0; int hashseq = 0;
/* /*
@@ -158,7 +158,7 @@ static Bignum rsa_privkey_op(Bignum input, const RSAKey *key)
* Conceptually the following few lines are equivalent to * Conceptually the following few lines are equivalent to
* byte = random_byte(); * byte = random_byte();
*/ */
if (digestused >= ARRAY_SIZE(digest512)) { if (digestused >= ARRAYSIZE(digest512)) {
unsigned char seqbuf[4]; unsigned char seqbuf[4];
PUT_32BIT(seqbuf, hashseq); PUT_32BIT(seqbuf, hashseq);
SHA512_Init(&ss); SHA512_Init(&ss);