- // concatenating an empty string is a NOP, but it happens quite rarely,
- // so we don't waste our time checking for it
- // if ( nSrcLen > 0 )
- wxStringData *pData = GetStringData();
- uint nLen = pData->nDataLength;
- uint nNewLen = nLen + nSrcLen;
-
- // alloc new buffer if current is too small
- if ( pData->IsShared() ) {
- STATISTICS_ADD(ConcatHit, 0);
-
- // we have to allocate another buffer
- wxStringData* pOldData = GetStringData();
- AllocBuffer(nNewLen);
- memcpy(m_pchData, pOldData->data(), nLen*sizeof(char));
- pOldData->Unlock();
- }
- else if ( nNewLen > pData->nAllocLength ) {
- STATISTICS_ADD(ConcatHit, 0);
+ // concatenating an empty string is a NOP
+ if ( nSrcLen > 0 ) {
+ wxStringData *pData = GetStringData();
+ size_t nLen = pData->nDataLength;
+ size_t nNewLen = nLen + nSrcLen;
+
+ // alloc new buffer if current is too small
+ if ( pData->IsShared() ) {
+ STATISTICS_ADD(ConcatHit, 0);
+
+ // we have to allocate another buffer
+ wxStringData* pOldData = GetStringData();
+ AllocBuffer(nNewLen);
+ memcpy(m_pchData, pOldData->data(), nLen*sizeof(char));
+ pOldData->Unlock();
+ }
+ else if ( nNewLen > pData->nAllocLength ) {
+ STATISTICS_ADD(ConcatHit, 0);