summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qcollator_win.cpp1
-rw-r--r--src/corelib/tools/qfreelist_p.h12
-rw-r--r--src/corelib/tools/qlocale_win.cpp6
-rw-r--r--src/corelib/tools/qmap.h6
4 files changed, 10 insertions, 15 deletions
diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp
index 9a672a0505..4141ba1205 100644
--- a/src/corelib/tools/qcollator_win.cpp
+++ b/src/corelib/tools/qcollator_win.cpp
@@ -155,6 +155,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
#elif defined(Q_OS_WINPHONE)
int size = 0;
Q_UNIMPLEMENTED();
+ Q_UNUSED(string)
#else // Q_OS_WINPHONE
int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator,
reinterpret_cast<LPCWSTR>(string.constData()), string.size(),
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index 5e90a03d7f..ca946cbd8a 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -73,7 +73,7 @@ struct QFreeListElement
typedef T &ReferenceType;
T _t;
- int next;
+ QAtomicInt next;
inline ConstReferenceType t() const { return _t; }
inline ReferenceType t() { return _t; }
@@ -81,7 +81,7 @@ struct QFreeListElement
/*! \internal
- Element in a QFreeList without a paylout. ConstReferenceType and
+ Element in a QFreeList without a payload. ConstReferenceType and
ReferenceType are void, the t() functions return void and are empty.
*/
template <>
@@ -90,7 +90,7 @@ struct QFreeListElement<void>
typedef void ConstReferenceType;
typedef void ReferenceType;
- int next;
+ QAtomicInt next;
inline void t() const { }
inline void t() { }
@@ -172,7 +172,7 @@ class QFreeList
// qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset);
ElementType *v = new ElementType[size];
for (int i = 0; i < size; ++i)
- v[i].next = offset + i + 1;
+ v[i].next.store(offset + i + 1);
return v;
}
@@ -254,7 +254,7 @@ inline int QFreeList<T, ConstantsType>::next()
}
}
- newid = v[at].next | (id & ~ConstantsType::IndexMask);
+ newid = v[at].next.load() | (id & ~ConstantsType::IndexMask);
} while (!_next.testAndSetRelaxed(id, newid));
// qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)",
// id & ConstantsType::IndexMask,
@@ -273,7 +273,7 @@ inline void QFreeList<T, ConstantsType>::release(int id)
int x, newid;
do {
x = _next.loadAcquire();
- v[at].next = x & ConstantsType::IndexMask;
+ v[at].next.store(x & ConstantsType::IndexMask);
newid = incrementserial(x, id);
} while (!_next.testAndSetRelease(x, newid));
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 1690dd83ee..4c44016fdf 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -663,10 +663,10 @@ QVariant QSystemLocalePrivate::uiLanguages()
unsigned int size;
languageList->get_Size(&size);
for (unsigned int i = 0; i < size; ++i) {
- HSTRING language;
- languageList->GetAt(i, &language);
+ HString language;
+ languageList->GetAt(i, language.GetAddressOf());
UINT32 length;
- PCWSTR rawString = WindowsGetStringRawBuffer(language, &length);
+ PCWSTR rawString = language.GetRawBuffer(&length);
result << QString::fromWCharArray(rawString, length);
}
#else // !Q_OS_WINPHONE
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 76f8bd6f17..d7bd9c739c 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -102,9 +102,6 @@ struct Q_CORE_EXPORT QMapNodeBase
void setColor(Color c) { if (c == Black) p |= Black; else p &= ~Black; }
QMapNodeBase *parent() const { return reinterpret_cast<QMapNodeBase *>(p & ~Mask); }
void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); }
-
- QMapNodeBase *minimumNode() { QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
- const QMapNodeBase *minimumNode() const { const QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
};
template <class Key, class T>
@@ -121,9 +118,6 @@ struct QMapNode : public QMapNodeBase
inline QMapNode *nextNode() { return static_cast<QMapNode *>(QMapNodeBase::nextNode()); }
inline QMapNode *previousNode() { return static_cast<QMapNode *>(QMapNodeBase::previousNode()); }
- QMapNode *minimumNode() { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
- const QMapNode *minimumNode() const { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
-
QMapNode<Key, T> *copy(QMapData<Key, T> *d) const;
void destroySubTree();