summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcontiguouscache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qcontiguouscache.h')
-rw-r--r--src/corelib/tools/qcontiguouscache.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index 7d52f1e..0020d22 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -166,8 +166,8 @@ void QContiguousCache<T>::detach_helper()
T *dest = x.d->array + x.d->start;
T *src = d->array + d->start;
- int count = x.d->count;
- while (count--) {
+ int oldcount = x.d->count;
+ while (oldcount--) {
if (QTypeInfo<T>::isComplex) {
new (dest) T(*src);
} else {
@@ -200,8 +200,8 @@ void QContiguousCache<T>::setCapacity(int asize)
x.d->start = x.d->offset % x.d->alloc;
T *dest = x.d->array + (x.d->start + x.d->count-1) % x.d->alloc;
T *src = d->array + (d->start + d->count-1) % d->alloc;
- int count = x.d->count;
- while (count--) {
+ int oldcount = x.d->count;
+ while (oldcount--) {
if (QTypeInfo<T>::isComplex) {
new (dest) T(*src);
} else {
@@ -224,10 +224,10 @@ void QContiguousCache<T>::clear()
{
if (d->ref == 1) {
if (QTypeInfo<T>::isComplex) {
- int count = d->count;
+ int oldcount = d->count;
T * i = d->array + d->start;
T * e = d->array + d->alloc;
- while (count--) {
+ while (oldcount--) {
i->~T();
i++;
if (i == e)
@@ -254,11 +254,11 @@ inline QContiguousCacheData *QContiguousCache<T>::malloc(int aalloc)
}
template <typename T>
-QContiguousCache<T>::QContiguousCache(int capacity)
+QContiguousCache<T>::QContiguousCache(int cap)
{
- p = malloc(capacity);
+ p = malloc(cap);
d->ref = 1;
- d->alloc = capacity;
+ d->alloc = cap;
d->count = d->start = d->offset = 0;
d->sharable = true;
}
@@ -295,10 +295,10 @@ template <typename T>
void QContiguousCache<T>::free(Data *x)
{
if (QTypeInfo<T>::isComplex) {
- int count = d->count;
+ int oldcount = d->count;
T * i = d->array + d->start;
T * e = d->array + d->alloc;
- while (count--) {
+ while (oldcount--) {
i->~T();
i++;
if (i == e)