From 3669ceb77968e55225fecc7f4232b5545c98a69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 4 Apr 2012 14:04:03 +0200 Subject: Rename realloc -> reallocData This avoids confusion with standard ::realloc. Change-Id: Ibeccf2f702ec37161033febf4f3926bee8f7aea6 Reviewed-by: Marius Storm-Olsen Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/corelib/tools/qbytearray.cpp') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 731a1b163b..2e9c1fb801 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -919,7 +919,7 @@ QByteArray &QByteArray::operator=(const char *str) } else { int len = strlen(str); if (d->ref.isShared() || len > int(d->alloc) || (len < d->size && len < int(d->alloc) >> 1)) - realloc(len); + reallocData(len); x = d; memcpy(x->data(), str, len + 1); // include null terminator x->size = len; @@ -1432,7 +1432,7 @@ void QByteArray::resize(int size) } else { if (d->ref.isShared() || size > int(d->alloc) || (!d->capacityReserved && size < d->size && size < int(d->alloc) >> 1)) - realloc(size, true); + reallocData(size, true); if (int(d->alloc) >= size) { d->size = size; d->data()[size] = '\0'; @@ -1459,7 +1459,7 @@ QByteArray &QByteArray::fill(char ch, int size) return *this; } -void QByteArray::realloc(int alloc, bool grow) +void QByteArray::reallocData(int alloc, bool grow) { if (grow) alloc = qAllocMore(alloc + 1, sizeof(Data)) - 1; @@ -1566,7 +1566,7 @@ QByteArray &QByteArray::prepend(const char *str, int len) { if (str) { if (d->ref.isShared() || d->size + len > int(d->alloc)) - realloc(d->size + len, true); + reallocData(d->size + len, true); memmove(d->data()+len, d->data(), d->size); memcpy(d->data(), str, len); d->size += len; @@ -1584,7 +1584,7 @@ QByteArray &QByteArray::prepend(const char *str, int len) QByteArray &QByteArray::prepend(char ch) { if (d->ref.isShared() || d->size + 1 > int(d->alloc)) - realloc(d->size + 1, true); + reallocData(d->size + 1, true); memmove(d->data()+1, d->data(), d->size); d->data()[0] = ch; ++d->size; @@ -1622,7 +1622,7 @@ QByteArray &QByteArray::append(const QByteArray &ba) *this = ba; } else if (ba.d != &shared_null.ba) { if (d->ref.isShared() || d->size + ba.d->size > int(d->alloc)) - realloc(d->size + ba.d->size, true); + reallocData(d->size + ba.d->size, true); memcpy(d->data() + d->size, ba.d->data(), ba.d->size); d->size += ba.d->size; d->data()[d->size] = '\0'; @@ -1656,7 +1656,7 @@ QByteArray& QByteArray::append(const char *str) if (str) { int len = strlen(str); if (d->ref.isShared() || d->size + len > int(d->alloc)) - realloc(d->size + len, true); + reallocData(d->size + len, true); memcpy(d->data() + d->size, str, len + 1); // include null terminator d->size += len; } @@ -1681,7 +1681,7 @@ QByteArray &QByteArray::append(const char *str, int len) len = qstrlen(str); if (str && len) { if (d->ref.isShared() || d->size + len > int(d->alloc)) - realloc(d->size + len, true); + reallocData(d->size + len, true); memcpy(d->data() + d->size, str, len); // include null terminator d->size += len; d->data()[d->size] = '\0'; @@ -1698,7 +1698,7 @@ QByteArray &QByteArray::append(const char *str, int len) QByteArray& QByteArray::append(char ch) { if (d->ref.isShared() || d->size + 1 > int(d->alloc)) - realloc(d->size + 1, true); + reallocData(d->size + 1, true); d->data()[d->size++] = ch; d->data()[d->size] = '\0'; return *this; -- cgit v1.2.3