aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2012-04-20 19:55:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-23 09:52:33 +0200
commit42e93ffffa23b466f6641f86de18e6a7dd71166c (patch)
treec86d77224c72acdd3e52b4a7f2d6be4832db0a77
parentb50aa539e854f1a10c5f012a448ab6977c3fc9ac (diff)
qMalloc, qFree, qRealloc, qMemCopy, qMemSet are deprecated
Use the stdlib version directly instead Change-Id: Ifc600f6c418b395c4ada9e5beb207ad3985575e3 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
-rw-r--r--src/qml/qml/ftw/qfinitestack_p.h4
-rw-r--r--src/qml/qml/ftw/qrecyclepool_p.h4
-rw-r--r--src/qml/qml/parser/qqmljsmemorypool_p.h8
-rw-r--r--src/qml/qml/qquicklistmodel.cpp4
-rw-r--r--src/qml/qml/v8/qjsconverter_impl_p.h2
-rw-r--r--src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp2
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp2
7 files changed, 13 insertions, 13 deletions
diff --git a/src/qml/qml/ftw/qfinitestack_p.h b/src/qml/qml/ftw/qfinitestack_p.h
index c5a9fbaedb..8ebcd062a7 100644
--- a/src/qml/qml/ftw/qfinitestack_p.h
+++ b/src/qml/qml/ftw/qfinitestack_p.h
@@ -160,7 +160,7 @@ void QFiniteStack<T>::allocate(int size)
if (!size) return;
- _array = (T *)qMalloc(size * sizeof(T));
+ _array = (T *)malloc(size * sizeof(T));
_alloc = size;
}
@@ -173,7 +173,7 @@ void QFiniteStack<T>::deallocate()
(--i)->~T();
}
- qFree(_array);
+ free(_array);
_array = 0;
_alloc = 0;
diff --git a/src/qml/qml/ftw/qrecyclepool_p.h b/src/qml/qml/ftw/qrecyclepool_p.h
index 8d0f060ab3..002eee4885 100644
--- a/src/qml/qml/ftw/qrecyclepool_p.h
+++ b/src/qml/qml/ftw/qrecyclepool_p.h
@@ -170,7 +170,7 @@ void QRecyclePoolPrivate<T, Step>::releaseIfPossible()
Page *p = currentPage;
while (p) {
Page *n = p->nextPage;
- qFree(p);
+ free(p);
p = n;
}
@@ -188,7 +188,7 @@ T *QRecyclePoolPrivate<T, Step>::allocate()
rv = (PoolType *)(currentPage->array + (Step - currentPage->free) * sizeof(PoolType));
currentPage->free--;
} else {
- Page *p = (Page *)qMalloc(sizeof(Page));
+ Page *p = (Page *)malloc(sizeof(Page));
p->nextPage = currentPage;
p->free = Step;
currentPage = p;
diff --git a/src/qml/qml/parser/qqmljsmemorypool_p.h b/src/qml/qml/parser/qqmljsmemorypool_p.h
index fd52fd25e4..facad4474d 100644
--- a/src/qml/qml/parser/qqmljsmemorypool_p.h
+++ b/src/qml/qml/parser/qqmljsmemorypool_p.h
@@ -84,10 +84,10 @@ public:
if (_blocks) {
for (int i = 0; i < _allocatedBlocks; ++i) {
if (char *b = _blocks[i])
- qFree(b);
+ free(b);
}
- qFree(_blocks);
+ free(_blocks);
}
}
@@ -119,7 +119,7 @@ private:
else
_allocatedBlocks *= 2;
- _blocks = (char **) qRealloc(_blocks, sizeof(char *) * _allocatedBlocks);
+ _blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
_blocks[index] = 0;
@@ -128,7 +128,7 @@ private:
char *&block = _blocks[_blockCount];
if (! block)
- block = (char *) qMalloc(BLOCK_SIZE);
+ block = (char *) malloc(BLOCK_SIZE);
_ptr = block;
_end = _ptr + BLOCK_SIZE;
diff --git a/src/qml/qml/qquicklistmodel.cpp b/src/qml/qml/qquicklistmodel.cpp
index 48187ca067..5f12036c37 100644
--- a/src/qml/qml/qquicklistmodel.cpp
+++ b/src/qml/qml/qquicklistmodel.cpp
@@ -952,7 +952,7 @@ ListElement::ListElement()
m_objectCache = 0;
uid = uidCounter.fetchAndAddOrdered(1);
next = 0;
- qMemSet(data, 0, sizeof(data));
+ memset(data, 0, sizeof(data));
}
ListElement::ListElement(int existingUid)
@@ -960,7 +960,7 @@ ListElement::ListElement(int existingUid)
m_objectCache = 0;
uid = existingUid;
next = 0;
- qMemSet(data, 0, sizeof(data));
+ memset(data, 0, sizeof(data));
}
ListElement::~ListElement()
diff --git a/src/qml/qml/v8/qjsconverter_impl_p.h b/src/qml/qml/v8/qjsconverter_impl_p.h
index ab004a543e..8715cfdf9a 100644
--- a/src/qml/qml/v8/qjsconverter_impl_p.h
+++ b/src/qml/qml/v8/qjsconverter_impl_p.h
@@ -106,7 +106,7 @@ QString QJSConverter::toString(double value)
int resultLen = endresult - result;
if (decpt <= 0 && decpt > -6) {
buf.resize(-decpt + 2 + sign);
- qMemSet(buf.data(), '0', -decpt + 2 + sign);
+ memset(buf.data(), '0', -decpt + 2 + sign);
if (sign) // fix the sign.
buf[0] = '-';
buf[sign + 1] = '.';
diff --git a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
index 7a219585b0..56d549e94f 100644
--- a/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgdefaultrenderer.cpp
@@ -453,7 +453,7 @@ void QSGDefaultRenderer::buildLists(QSGNode *node)
}
Q_ASSERT(m_tempNodes.size() == m_transparentNodes.size() - baseCount);
- qMemCopy(&m_transparentNodes.at(baseCount), &m_tempNodes.at(0), m_tempNodes.size() * sizeof(QSGGeometryNode *));
+ memcpy(&m_transparentNodes.at(baseCount), &m_tempNodes.at(0), m_tempNodes.size() * sizeof(QSGGeometryNode *));
}
} else {
for (QSGNode *c = node->firstChild(); c; c = c->nextSibling())
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 2b2ccfe317..aa2c78f84a 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -164,7 +164,7 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QHash<glyph_t, QImage>
uchar *inBits = glyph.scanLine(0);
uchar *outBits = texInfo->image.scanLine(int(c.y)) + int(c.x);
for (int y = 0; y < glyph.height(); ++y) {
- qMemCopy(outBits, inBits, glyph.width());
+ memcpy(outBits, inBits, glyph.width());
inBits += glyph.bytesPerLine();
outBits += texInfo->image.bytesPerLine();
}