QtNetwork: Fix const correctness in old style casts

Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c946859c282001
Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
Thiago Macieira 2015-03-05 22:25:45 -08:00
parent c286afee3a
commit 08e45154fb
2 changed files with 5 additions and 5 deletions

View File

@ -691,7 +691,7 @@ QList<QSslCertificate> QSslCertificatePrivate::certificatesFromDer(const QByteAr
} else {
break;
}
size -= ((char *)data - der.data());
size -= ((const char *)data - der.data());
}
return certificates;

View File

@ -139,7 +139,7 @@ void QSslKeyPrivate::decodePem(const QByteArray &pem, const QByteArray &passPhra
if (!bio)
return;
void *phrase = (void *)passPhrase.constData();
void *phrase = const_cast<char *>(passPhrase.constData());
if (algorithm == QSsl::Rsa) {
RSA *result = (type == QSsl::PublicKey)
@ -201,7 +201,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const
bio, rsa,
// ### the cipher should be selectable in the API:
passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(),
(uchar *)passPhrase.data(), passPhrase.size(), 0, 0)) {
const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) {
fail = true;
}
}
@ -214,7 +214,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const
bio, dsa,
// ### the cipher should be selectable in the API:
passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(),
(uchar *)passPhrase.data(), passPhrase.size(), 0, 0)) {
const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) {
fail = true;
}
}
@ -228,7 +228,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const
bio, ec,
// ### the cipher should be selectable in the API:
passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(),
(uchar *)passPhrase.data(), passPhrase.size(), 0, 0)) {
const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) {
fail = true;
}
}