X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2db0bbdecd8b979c00eef0276075d1e314b35d93..14c90e0074aa2a5eb7a009d356a8181475ee7233:/src/common/memory.cpp diff --git a/src/common/memory.cpp b/src/common/memory.cpp index a1659e5bd1..6679675ab0 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -461,12 +461,12 @@ int wxMemStruct::ValidateNode () wxMemStruct *wxDebugContext::m_head = NULL; wxMemStruct *wxDebugContext::m_tail = NULL; -// ostream *wxDebugContext::m_debugStream = NULL; -// streambuf *wxDebugContext::m_streamBuf = NULL; +// wxSTD ostream *wxDebugContext::m_debugStream = NULL; +// wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; // Must initialise these in wxEntry, and then delete them just before wxEntry exits -streambuf *wxDebugContext::m_streamBuf = NULL; -ostream *wxDebugContext::m_debugStream = NULL; +wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; +wxSTD ostream *wxDebugContext::m_debugStream = NULL; bool wxDebugContext::m_checkPrevious = FALSE; int wxDebugContext::debugLevel = 1; @@ -481,7 +481,7 @@ int wxDebugContext::m_balignmask = (int)((char *)&markerCalc[1] - (char*)&marker wxDebugContext::wxDebugContext(void) { // m_streamBuf = new wxDebugStreamBuf; -// m_debugStream = new ostream(m_streamBuf); +// m_debugStream = new wxSTD ostream(m_streamBuf); } wxDebugContext::~wxDebugContext(void) @@ -494,7 +494,7 @@ wxDebugContext::~wxDebugContext(void) * between SetFile and SetStream. */ -void wxDebugContext::SetStream(ostream *str, streambuf *buf) +void wxDebugContext::SetStream(wxSTD ostream *str, wxSTD streambuf *buf) { if (m_debugStream) { @@ -508,7 +508,7 @@ void wxDebugContext::SetStream(ostream *str, streambuf *buf) #ifndef __WATCOMC__ if (m_streamBuf) { - streambuf* oldBuf = m_streamBuf; + wxSTD streambuf* oldBuf = m_streamBuf; m_streamBuf = NULL; delete oldBuf; } @@ -519,7 +519,7 @@ void wxDebugContext::SetStream(ostream *str, streambuf *buf) bool wxDebugContext::SetFile(const wxString& file) { - ofstream *str = new ofstream(file.mb_str()); + wxSTD ofstream *str = new wxSTD ofstream(file.mb_str()); if (str->bad()) { @@ -539,7 +539,7 @@ bool wxDebugContext::SetStandardError(void) #if 0 #if !defined(_WINDLL) wxDebugStreamBuf *buf = new wxDebugStreamBuf; - ostream *stream = new ostream(m_streamBuf); + wxSTD ostream *stream = new wxSTD ostream(m_streamBuf); SetStream(stream, buf); return TRUE; #else @@ -615,13 +615,13 @@ size_t wxDebugContext::PaddedSize (const size_t size) { // Added by Terry Farnham to replace // slow GetPadding call. - int padb; + int padb; - padb = size & m_balignmask; - if(padb) - return(size + m_balign - padb); - else - return(size); + padb = size & m_balignmask; + if(padb) + return(size + m_balign - padb); + else + return(size); // Old (slow) code #if 0 @@ -711,6 +711,7 @@ bool wxDebugContext::Dump(void) #endif } +#ifdef __WXDEBUG__ struct wxDebugStatsStruct { long instanceCount; @@ -735,6 +736,7 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt st->next = head; return st; } +#endif bool wxDebugContext::PrintStatistics(bool detailed) { @@ -783,7 +785,7 @@ bool wxDebugContext::PrintStatistics(bool detailed) { wxObject *obj = (wxObject *)st->GetActualData(); if (obj->GetClassInfo()->GetClassName()) - className = obj->GetClassInfo()->GetClassName(); + className = (wxChar*)obj->GetClassInfo()->GetClassName(); } wxDebugStatsStruct *stats = FindStatsStruct(list, className); if (!stats) @@ -832,6 +834,7 @@ bool wxDebugContext::PrintStatistics(bool detailed) return TRUE; #else + (void)detailed; return FALSE; #endif } @@ -951,6 +954,10 @@ void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, // If not in debugging allocation mode, do the normal thing // so we don't leave any trace of ourselves in the node list. +#if defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ) +// VA 3.0 still has trouble in here + return (void *)malloc(size); +#endif if (!wxDebugContext::GetDebugMode()) { return (void *)malloc(size); @@ -1003,6 +1010,10 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) if (!buf) return; +#if defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ) +// VA 3.0 still has trouble in here + free((char *)buf); +#endif // If not in debugging allocation mode, do the normal thing // so we don't leave any trace of ourselves in the node list. if (!wxDebugContext::GetDebugMode()) @@ -1043,7 +1054,7 @@ void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) } // Trace: send output to the current debugging stream -void wxTrace(const wxChar *fmt ...) +void wxTrace(const wxChar * ...) { #if 1 wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead.")); @@ -1080,7 +1091,7 @@ void wxTrace(const wxChar *fmt ...) } // Trace with level -void wxTraceLevel(int level, const wxChar *fmt ...) +void wxTraceLevel(int, const wxChar * ...) { #if 1 wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead."));