aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-05 15:22:11 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-05 17:55:22 +0000
commit81f128c5f09a7cae9e549458bcf23943b0b9a351 (patch)
tree56c210a10ea20d50afe454fbef5f603f9611faea /sources/shiboken2/generator/shiboken2
parent3748e8fa9830e97466f12104501d4acf104260a5 (diff)
Replace the deprecated Qt algorithms by their std:: equivalents
Fix warnings occurring in 5.13: sources/shiboken2/ApiExtractor/abstractmetalang.cpp:1431:66: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = AbstractMetaFunction**; LessThan = bool (*)(AbstractMetaFunction*, AbstractMetaFunction*)]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:358:43: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = Include*]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1683:55: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = QList<QString>::iterator]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5500:53: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = Include*]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:1585:65: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = AbstractMetaFunction**; LessThan = bool (*)(const AbstractMetaFunction*, const AbstractMetaFunction*)]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:1681:24: warning: ‘void qSort(Container&) [with Container = QStringList]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:2054:25: warning: ‘void qSort(Container&) [with Container = QStringList]’ is deprecated: Use std::sort [-Wdeprecated-declarations] Change-Id: If6940941ac31327597ce362a31b27773f4d5b94c Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 56f53f304..0ca0b8d04 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -43,6 +43,10 @@
#include <QtCore/QDebug>
#include <QMetaType>
+#include <algorithm>
+
+#include <algorithm>
+
static const char CPP_ARG0[] = "cppArg0";
QHash<QString, QString> CppGenerator::m_nbFuncs = QHash<QString, QString>();
@@ -355,7 +359,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
QVector<Include> includes = metaClass->typeEntry()->extraIncludes();
for (AbstractMetaEnum *cppEnum : qAsConst(classEnums))
includes.append(cppEnum->typeEntry()->extraIncludes());
- qSort(includes.begin(), includes.end());
+ std::sort(includes.begin(), includes.end());
for (const Include &inc : qAsConst(includes))
s << inc.toString() << endl;
s << endl;
@@ -1680,7 +1684,7 @@ void CppGenerator::writeConstructorWrapper(QTextStream &s, const AbstractMetaFun
}
}
QStringList argNamesList = argNamesSet.toList();
- qSort(argNamesList.begin(), argNamesList.end());
+ std::sort(argNamesList.begin(), argNamesList.end());
if (argNamesList.isEmpty()) {
s << INDENT << "const char** argNames{};" << endl;
} else {
@@ -5503,7 +5507,7 @@ bool CppGenerator::finishGeneration()
QVector<Include> extraIncludes = moduleEntry->extraIncludes();
for (AbstractMetaEnum *cppEnum : qAsConst(globalEnums))
extraIncludes.append(cppEnum->typeEntry()->extraIncludes());
- qSort(extraIncludes.begin(), extraIncludes.end());
+ std::sort(extraIncludes.begin(), extraIncludes.end());
for (const Include &inc : qAsConst(extraIncludes))
s << inc;
s << endl;