X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22dec51f90235d04277b7f2e2f5fee99ed4753b9..052d2fc5818243dadbc1ec54b1120e295304fc55:/src/common/log.cpp diff --git a/src/common/log.cpp b/src/common/log.cpp index 98e8b62cd9..7796bf94d4 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -367,10 +367,6 @@ void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...) // wxLog class implementation // ---------------------------------------------------------------------------- -wxLog::wxLog() -{ -} - wxChar *wxLog::SetLogBuffer( wxChar *buf, size_t size) { wxChar *oldbuf = s_szBuf; @@ -394,9 +390,9 @@ wxLog *wxLog::GetActiveTarget() if ( ms_bAutoCreate && ms_pLogger == NULL ) { // prevent infinite recursion if someone calls wxLogXXX() from // wxApp::CreateLogTarget() - static bool s_bInGetActiveTarget = FALSE; + static bool s_bInGetActiveTarget = false; if ( !s_bInGetActiveTarget ) { - s_bInGetActiveTarget = TRUE; + s_bInGetActiveTarget = true; // ask the application to create a log target for us if ( wxTheApp != NULL ) @@ -404,7 +400,7 @@ wxLog *wxLog::GetActiveTarget() else ms_pLogger = new wxLogStderr; - s_bInGetActiveTarget = FALSE; + s_bInGetActiveTarget = false; // do nothing if it fails - what can we do? } @@ -429,7 +425,7 @@ wxLog *wxLog::SetActiveTarget(wxLog *pLogger) void wxLog::DontCreateOnDemand() { - ms_bAutoCreate = FALSE; + ms_bAutoCreate = false; // this is usually called at the end of the program and we assume that it // is *always* called at the end - so we free memory here to avoid false @@ -558,7 +554,8 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; if ( traits && !traits->HasStderr() ) { - wxMessageOutputDebug().Printf(_T("%s"), str.c_str()); + wxMessageOutputDebug dbgout; + dbgout.Printf(_T("%s"), str.c_str()); } } } @@ -591,7 +588,7 @@ void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) wxLogChain::wxLogChain(wxLog *logger) { - m_bPassMessages = TRUE; + m_bPassMessages = true; m_logNew = logger; m_logOld = wxLog::SetActiveTarget(this); @@ -630,16 +627,12 @@ void wxLogChain::DoLog(wxLogLevel level, const wxChar *szString, time_t t) { // bogus cast just to access protected DoLog ((wxLogChain *)m_logOld)->DoLog(level, szString, t); - - m_bHasMessages |= m_logOld->HasPendingMessages(); } if ( m_logNew && m_logNew != this ) { // as above... ((wxLogChain *)m_logNew)->DoLog(level, szString, t); - - m_bHasMessages |= m_logNew->HasPendingMessages(); } } @@ -670,9 +663,9 @@ wxLogPassThrough::wxLogPassThrough() // ---------------------------------------------------------------------------- wxLog *wxLog::ms_pLogger = (wxLog *)NULL; -bool wxLog::ms_doLog = TRUE; -bool wxLog::ms_bAutoCreate = TRUE; -bool wxLog::ms_bVerbose = FALSE; +bool wxLog::ms_doLog = true; +bool wxLog::ms_bAutoCreate = true; +bool wxLog::ms_bVerbose = false; wxLogLevel wxLog::ms_logLevel = wxLOG_Max; // log everything by default @@ -753,7 +746,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) // copy it to our buffer and free memory // Crashes on SmartPhone -#if !defined(__SMARTPHONE__) +#if !defined(__SMARTPHONE__) /* of WinCE */ if( lpMsgBuf != 0 ) { wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0');