Compile with QT_STRICT_ITERATORS defined
This will be the only options for Qt 6, so make sure the code compiles now. Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
c2bf0cac95
commit
b98c43ea60
@ -624,7 +624,7 @@ MakefileGenerator::init()
|
||||
compiler.flags |= Compiler::CompilerNoCheckDeps;
|
||||
compilers.append(compiler);
|
||||
}
|
||||
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
||||
for (ProStringList::ConstIterator it = quc.cbegin(); it != quc.cend(); ++it) {
|
||||
const ProStringList &inputs = v[ProKey(*it + ".input")];
|
||||
for(x = 0; x < inputs.size(); ++x) {
|
||||
Compiler compiler;
|
||||
@ -1878,7 +1878,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
|
||||
replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell)));
|
||||
} else {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
|
||||
replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell)));
|
||||
}
|
||||
@ -1912,7 +1912,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
const QString del_statement("-$(DEL_FILE)");
|
||||
if(!wrote_clean) {
|
||||
QStringList dels;
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
QString tinp = (*input).toQString();
|
||||
QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell);
|
||||
for (const QString &rc : qAsConst(raw_clean)) {
|
||||
@ -1940,7 +1940,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
if(!cleans.isEmpty())
|
||||
t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, "");
|
||||
if(!wrote_clean_cmds) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
QString tinp = (*input).toQString();
|
||||
t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, tinp,
|
||||
replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell);
|
||||
@ -1959,7 +1959,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
QStringList deps, inputs;
|
||||
if(!tmp_dep.isEmpty())
|
||||
deps += fileFixify(tmp_dep, FileFixifyFromOutdir);
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
QString inpf = (*input).toQString();
|
||||
deps += findDependencies(inpf);
|
||||
inputs += Option::fixPathToTargetOS(inpf, false);
|
||||
@ -2043,7 +2043,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
t << "\n\t" << cmd << endl << endl;
|
||||
continue;
|
||||
}
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
QString inpf = (*input).toQString();
|
||||
QString in = Option::fixPathToTargetOS(inpf, false);
|
||||
QStringList deps = findDependencies(inpf);
|
||||
@ -3350,7 +3350,7 @@ MakefileGenerator::writePkgConfigFile()
|
||||
libs << "QMAKE_LIBS_PRIVATE";
|
||||
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
|
||||
t << "Libs.private:";
|
||||
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
|
||||
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
|
||||
t << ' ' << fixLibFlags((*it).toKey()).join(' ');
|
||||
t << endl;
|
||||
}
|
||||
|
@ -1485,7 +1485,7 @@ UnixMakefileGenerator::writeLibtoolFile()
|
||||
ProStringList libs;
|
||||
libs << "LIBS" << "QMAKE_LIBS";
|
||||
t << "dependency_libs='";
|
||||
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
|
||||
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
|
||||
t << fixLibFlags((*it).toKey()).join(' ') << ' ';
|
||||
t << "'\n\n";
|
||||
|
||||
|
@ -477,8 +477,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
|
||||
// Add all unknown libs to the deps
|
||||
QStringList where = QStringList() << "LIBS" << "LIBS_PRIVATE"
|
||||
<< "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE";
|
||||
for (QStringList::ConstIterator wit = where.begin();
|
||||
wit != where.end(); ++wit) {
|
||||
for (QStringList::ConstIterator wit = where.cbegin();
|
||||
wit != where.cend(); ++wit) {
|
||||
const ProStringList &l = tmp_proj.values(ProKey(*wit));
|
||||
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
|
||||
const QString opt = fixLibFlag(*it).toQString();
|
||||
|
@ -112,8 +112,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
||||
goto found;
|
||||
}
|
||||
QString libBase = (*dir_it).local() + '/' + lib + verovr;
|
||||
for (ProStringList::ConstIterator extit = impexts.begin();
|
||||
extit != impexts.end(); ++extit) {
|
||||
for (ProStringList::ConstIterator extit = impexts.cbegin();
|
||||
extit != impexts.cend(); ++extit) {
|
||||
if (exists(libBase + '.' + *extit)) {
|
||||
(*it) = cand + verovr + '.' + *extit;
|
||||
goto found;
|
||||
|
@ -178,8 +178,8 @@ QMakeProperty::exec()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
for(QStringList::ConstIterator it = Option::prop::properties.begin();
|
||||
it != Option::prop::properties.end(); it++) {
|
||||
for (QStringList::ConstIterator it = Option::prop::properties.cbegin();
|
||||
it != Option::prop::properties.cend(); it++) {
|
||||
if(Option::prop::properties.count() > 1)
|
||||
fprintf(stdout, "%s:", (*it).toLatin1().constData());
|
||||
const ProKey pkey(*it);
|
||||
@ -191,11 +191,11 @@ QMakeProperty::exec()
|
||||
}
|
||||
}
|
||||
} else if(Option::qmake_mode == Option::QMAKE_SET_PROPERTY) {
|
||||
for(QStringList::ConstIterator it = Option::prop::properties.begin();
|
||||
it != Option::prop::properties.end(); it++) {
|
||||
for (QStringList::ConstIterator it = Option::prop::properties.cbegin();
|
||||
it != Option::prop::properties.cend(); it++) {
|
||||
QString var = (*it);
|
||||
it++;
|
||||
if(it == Option::prop::properties.end()) {
|
||||
if (it == Option::prop::properties.cend()) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
@ -203,8 +203,8 @@ QMakeProperty::exec()
|
||||
setValue(var, (*it));
|
||||
}
|
||||
} else if(Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) {
|
||||
for(QStringList::ConstIterator it = Option::prop::properties.begin();
|
||||
it != Option::prop::properties.end(); it++) {
|
||||
for (QStringList::ConstIterator it = Option::prop::properties.cbegin();
|
||||
it != Option::prop::properties.cend(); it++) {
|
||||
QString var = (*it);
|
||||
if(!var.startsWith("."))
|
||||
remove(var);
|
||||
|
@ -505,9 +505,9 @@ QTextCodec::~QTextCodec()
|
||||
|
||||
globalData->allCodecs.removeOne(this);
|
||||
|
||||
auto it = globalData->codecCache.cbegin();
|
||||
auto it = globalData->codecCache.begin();
|
||||
|
||||
while (it != globalData->codecCache.cend()) {
|
||||
while (it != globalData->codecCache.end()) {
|
||||
if (it.value() == this)
|
||||
it = globalData->codecCache.erase(it);
|
||||
else
|
||||
|
@ -257,7 +257,7 @@ qint32 QXcbEventQueue::generatePeekerId()
|
||||
|
||||
bool QXcbEventQueue::removePeekerId(qint32 peekerId)
|
||||
{
|
||||
const auto it = m_peekerToNode.find(peekerId);
|
||||
const auto it = m_peekerToNode.constFind(peekerId);
|
||||
if (it == m_peekerToNode.constEnd()) {
|
||||
qCWarning(lcQpaXcb, "failed to remove unknown peeker id: %d", peekerId);
|
||||
return false;
|
||||
@ -276,7 +276,7 @@ bool QXcbEventQueue::peekEventQueue(PeekerCallback peeker, void *peekerData,
|
||||
const bool peekerIdProvided = peekerId != -1;
|
||||
auto peekerToNodeIt = m_peekerToNode.find(peekerId);
|
||||
|
||||
if (peekerIdProvided && peekerToNodeIt == m_peekerToNode.constEnd()) {
|
||||
if (peekerIdProvided && peekerToNodeIt == m_peekerToNode.end()) {
|
||||
qCWarning(lcQpaXcb, "failed to find index for unknown peeker id: %d", peekerId);
|
||||
return false;
|
||||
}
|
||||
@ -336,7 +336,7 @@ bool QXcbEventQueue::peekEventQueue(PeekerCallback peeker, void *peekerData,
|
||||
// Before updating, make sure that a peeker callback did not remove
|
||||
// the peeker id.
|
||||
peekerToNodeIt = m_peekerToNode.find(peekerId);
|
||||
if (peekerToNodeIt != m_peekerToNode.constEnd())
|
||||
if (peekerToNodeIt != m_peekerToNode.end())
|
||||
*peekerToNodeIt = node; // id still in the cache, update node
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,8 @@ public:
|
||||
public:
|
||||
const_iterator () {}
|
||||
|
||||
const_iterator (const typename _Base::iterator &it):
|
||||
_M_iterator (typename _Base::const_iterator(it)) {}
|
||||
const_iterator (const typename _Base::const_iterator &it):
|
||||
_M_iterator (it) {}
|
||||
|
||||
|
@ -360,8 +360,8 @@ void tst_QApplication::setFont_data()
|
||||
int cnt = 0;
|
||||
QFontDatabase fdb;
|
||||
QStringList families = fdb.families();
|
||||
for (QStringList::const_iterator itr = families.begin();
|
||||
itr != families.end();
|
||||
for (QStringList::const_iterator itr = families.cbegin();
|
||||
itr != families.cend();
|
||||
++itr) {
|
||||
if (cnt < 3) {
|
||||
QString family = *itr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user