From 8fb45ae5b8b8ad276aeb9bc9e40f351f47523087 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 4 Jun 2012 22:04:13 +0200 Subject: Introduce QArrayData::allocatedCapacity() and use it instead of d->alloc In almost all cases, use d->allocatedCapacity() or d->constAllocatedCapacity() instead of d->alloc, since they do the same thing (right now). In the future, the functions will be changed. There is a separate const version because most const code should not need to know the allocation size -- only mutating code should need to know that There are a few cases where d->alloc was replaced with a better alternative, like d->size. The one case that remains in the code will be replaced by a different test when it's available. Change-Id: I48135469db4caf150f82df93fff42d2309b23719 Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/kernel/qmetaobject.cpp') diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index b51bb616b2..d9feb76d04 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -159,7 +159,7 @@ static inline const QByteArray stringData(const QMetaObject *mo, int index) Q_ASSERT(priv(mo->d.data)->revision >= 7); const QByteArrayDataPtr data = { const_cast(&mo->d.stringdata[index]) }; Q_ASSERT(data.ptr->ref.isStatic()); - Q_ASSERT(data.ptr->alloc == 0); + Q_ASSERT(data.ptr->allocatedCapacity() == 0); Q_ASSERT(data.ptr->size >= 0); return data; } -- cgit v1.2.3