diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-05 22:25:45 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-12 02:46:59 +0000 |
commit | 08e45154fb508162cb4bab104f6a7c9d00c2e50d (patch) | |
tree | 2ab5b9017f69d19d2161fa53bf5ec1135d99c851 /src/network | |
parent | c286afee3a817ffcfe0aba5fbe7c36cd791beda9 (diff) |
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>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslcertificate_openssl.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslkey_openssl.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp index 0ef845bf55..ad88ea5d56 100644 --- a/src/network/ssl/qsslcertificate_openssl.cpp +++ b/src/network/ssl/qsslcertificate_openssl.cpp @@ -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; diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp index 8741ab524f..33cb81ce71 100644 --- a/src/network/ssl/qsslkey_openssl.cpp +++ b/src/network/ssl/qsslkey_openssl.cpp @@ -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; } } |