From d93f63db9d836a7d303343e60fb034dc9a1360d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Aug 1998 22:03:16 +0000 Subject: [PATCH] couple of minor bug fixes/enhancements (interface unchanged) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dynarray.cpp | 3 ++- src/common/log.cpp | 2 +- src/common/string.cpp | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index fbf3972fe3..db5396e0ad 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -100,7 +100,8 @@ void wxBaseArray::Grow() else { // add 50% but not too much - uint uiIncrement = m_uiSize >> 1; + uint uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE + ? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1; if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT ) uiIncrement = ARRAY_MAXSIZE_INCREMENT; m_uiSize += uiIncrement; diff --git a/src/common/log.cpp b/src/common/log.cpp index aba5c2c1f2..4eb067ff36 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -153,7 +153,7 @@ void wxLogVerbose(const char *szFormat, ...) // we check that all of mask bits are set in the current mask, so // that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something // if both bits are set. - if ( pLog != NULL && (pLog->GetTraceMask() & mask == mask) ) { + if ( pLog != NULL && ((pLog->GetTraceMask() & mask) == mask) ) { va_list argptr; va_start(argptr, szFormat); vsprintf(s_szBuf, szFormat, argptr); diff --git a/src/common/string.cpp b/src/common/string.cpp index ac64abaeb6..7e6e2270d7 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1089,9 +1089,9 @@ wxArrayString::wxArrayString(const wxArrayString& src) // assignment operator wxArrayString& wxArrayString::operator=(const wxArrayString& src) { - Clear(); + if ( m_nSize > 0 ) + Clear(); - m_nSize = 0; if ( src.m_nCount > ARRAY_DEFAULT_INITIAL_SIZE ) Alloc(src.m_nCount); -- 2.45.2