From 2c8a4fae8441df9d0f6423d28c2b16e6e99b3d49 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 1 Sep 2011 11:58:22 +0200 Subject: [PATCH] Rename the private helper function QList::free() to QList::dealloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the comment suggests, renaming this function avoids confusion with libc's free(). Change-Id: Ia077b92c947d81ef9d78de940a1cd8ed022edb3c Reviewed-on: http://codereview.qt.nokia.com/4063 Reviewed-by: Qt Sanity Bot Reviewed-by: Samuel Rødal --- src/corelib/tools/qlist.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 7270ba98e7..b4c35b8d35 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -334,7 +334,7 @@ private: Node *detach_helper_grow(int i, int n); void detach_helper(int alloc); void detach_helper(); - void free(QListData::Data *d); + void dealloc(QListData::Data *d); void node_construct(Node *n, const T &t); void node_destruct(Node *n); @@ -422,7 +422,7 @@ Q_INLINE_TEMPLATE QList &QList::operator=(const QList &l) QListData::Data *o = l.d; o->ref.ref(); if (!d->ref.deref()) - free(d); + dealloc(d); d = o; if (!d->sharable) detach_helper(); @@ -679,7 +679,7 @@ Q_OUTOFLINE_TEMPLATE typename QList::Node *QList::detach_helper_grow(int i } if (!x->ref.deref()) - free(x); + dealloc(x); return reinterpret_cast(p.begin() + i); } @@ -698,7 +698,7 @@ Q_OUTOFLINE_TEMPLATE void QList::detach_helper(int alloc) } if (!x->ref.deref()) - free(x); + dealloc(x); } template @@ -711,7 +711,7 @@ template Q_OUTOFLINE_TEMPLATE QList::~QList() { if (!d->ref.deref()) - free(d); + dealloc(d); } template @@ -732,9 +732,8 @@ Q_OUTOFLINE_TEMPLATE bool QList::operator==(const QList &l) const return true; } -// ### Qt 5: rename freeData() to avoid confusion with std::free() template -Q_OUTOFLINE_TEMPLATE void QList::free(QListData::Data *data) +Q_OUTOFLINE_TEMPLATE void QList::dealloc(QListData::Data *data) { node_destruct(reinterpret_cast(data->array + data->begin), reinterpret_cast(data->array + data->end));