- fix w4 warnings

- add convenience macros for config_db(CFG_GET_SYS_VAL)
- VFSUtil::EnumDirEnts now uses flags instead of bool recursive
- UNUSED() for params, UNUSED2 (<- need better name) for variables
- config.h defines must be tested with #if (always defined) -> allows
detecting misspellings thanks to compiler warnings
- replace debug_assert(0) with debug_warn (its sole purpose)
- replace ScriptingHost::ValueToInt et al with ToPrimitive
- use nommgr.h to disable both mmgr and VC debug heap

This was SVN commit r2585.
This commit is contained in:
janwas
2005-08-09 15:55:44 +00:00
parent 630b375f4d
commit a69ac0dee9
115 changed files with 654 additions and 600 deletions
+6 -4
View File
@@ -470,10 +470,11 @@ void CConsole::SetBuffer(const wchar_t* szMessage, ...)
m_iBufferLength = m_iBufferPos = (int)wcslen(m_szBuffer);
}
void CConsole::UseHistoryFile( CStr filename, unsigned int historysize )
void CConsole::UseHistoryFile( CStr filename, int max_history_lines )
{
m_MaxHistoryLines = max_history_lines;
m_sHistoryFile = filename;
m_iHistorySize = historysize;
LoadHistory();
}
@@ -592,10 +593,11 @@ void CConsole::SaveHistory()
{
CStr buffer;
std::deque<std::wstring>::iterator it;
unsigned int count = 0;
int line_count = 0;
for( it = m_deqBufHistory.begin(); it != m_deqBufHistory.end(); ++it )
{
if( count++ >= m_iHistorySize ) break;
if(line_count++ >= m_MaxHistoryLines)
break;
buffer = CStrW( *it ).ToUTF8() + "\n" + buffer;
}
vfs_store( m_sHistoryFile, (void*)buffer.c_str(), buffer.Length(), FILE_NO_AIO );