static analyzer warnings fixes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-01-05 08:31:16 +02:00
parent a8f2b1770e
commit 399e99f4d5
2 changed files with 7 additions and 8 deletions

View file

@ -181,7 +181,9 @@ bool QUdpSocketPrivate::doEnsureInitialized(const QHostAddress &bindAddress, qui
QAbstractSocket::NetworkLayerProtocol proto = address->protocol();
if (proto == QUdpSocket::UnknownNetworkLayerProtocol) {
address = &remoteAddress;
#if defined(QT_NO_IPV6)
proto = address->protocol();
#endif
}
#if defined(QT_NO_IPV6)

View file

@ -3886,16 +3886,13 @@ bool QXmlSimpleReaderPrivate::processElementEmptyTag()
return false;
}
// ... followed by endPrefixMapping
QStringList prefixesBefore, prefixesAfter;
if (contentHnd) {
prefixesBefore = namespaceSupport.prefixes();
}
QStringList prefixesBefore = namespaceSupport.prefixes();
namespaceSupport.popContext();
// call the handler for prefix mapping
prefixesAfter = namespaceSupport.prefixes();
for (QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end(); ++it) {
if (!prefixesAfter.contains(*it)) {
if (!contentHnd->endPrefixMapping(*it)) {
QStringList prefixesAfter = namespaceSupport.prefixes();
foreach (const QString &it, prefixesBefore) {
if (!prefixesAfter.contains(it)) {
if (!contentHnd->endPrefixMapping(it)) {
reportParseError(contentHnd->errorString());
return false;
}