From bf0b4f332a2f1ec9860c610d98cd27e483869bec Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 4 Jun 2012 21:06:49 +0200 Subject: Rename QArrayData::AllocateOptions enum and update some flags Rename to QArrayData::ArrayOptions in preparation for these flags being in the array itself, instead of used just for allocating new ones. For that reason, rename QArrayData::Default to DefaultAllocationFlags. And introduce QArray::DefaultRawFlags to mean the flags needed for creating a raw (static) QArrayData. Also rename QArrayData::Grow to GrowsForward, so we may add GrowsBackward in the future. Change-Id: I536d9b34124f775d53cf810f62d6b0eaada8daef Reviewed-by: Simon Hausmann --- src/corelib/tools/qarraydata.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qarraydata.cpp') diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp index ed7dfe2e41..592faf39c3 100644 --- a/src/corelib/tools/qarraydata.cpp +++ b/src/corelib/tools/qarraydata.cpp @@ -170,7 +170,7 @@ static inline size_t calculateBlockSize(size_t &capacity, size_t objectSize, siz // Calculate the byte size // allocSize = objectSize * capacity + headerSize, but checked for overflow // plus padded to grow in size - if (options & QArrayData::Grow) { + if (options & QArrayData::GrowsForward) { auto r = qCalculateGrowingBlockSize(capacity, objectSize, headerSize); capacity = r.elementCount; return r.size; @@ -188,7 +188,7 @@ static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint opt } QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, - size_t capacity, AllocationOptions options) noexcept + size_t capacity, ArrayOptions options) noexcept { // Alignment is a power of two Q_ASSERT(alignment >= alignof(QArrayData) @@ -227,7 +227,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, } QArrayData *QArrayData::reallocateUnaligned(QArrayData *data, size_t objectSize, size_t capacity, - AllocationOptions options) noexcept + ArrayOptions options) noexcept { Q_ASSERT(data); Q_ASSERT(data->isMutable()); -- cgit v1.2.3