diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-01 12:36:16 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-01 15:56:34 (GMT) |
commit | eddd92ed76ae68cb1e202602fd3ebd11b69191a2 (patch) | |
tree | 8d396e5801d77a2f0ee4ab8e4c5093d8cf8118e6 /Swiften/TLS/SecureTransport/SecureTransportCertificate.mm | |
parent | a79db8d446e152b715f435550c2a6e10a36ee532 (diff) | |
download | swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.zip swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.tar.bz2 |
Modernize code to use C++11 nullptr using clang-tidy
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all
source code files on OS X. This does not modernize platform
specific code on Linux and Windows
Test-Information:
Code builds and unit tests pass on OS X 10.11.4.
Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
Diffstat (limited to 'Swiften/TLS/SecureTransport/SecureTransportCertificate.mm')
-rw-r--r-- | Swiften/TLS/SecureTransport/SecureTransportCertificate.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm index 398829c..ed47f56 100644 --- a/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm +++ b/Swiften/TLS/SecureTransport/SecureTransportCertificate.mm @@ -49,9 +49,9 @@ SecureTransportCertificate::SecureTransportCertificate(SecCertificateRef certifi SecureTransportCertificate::SecureTransportCertificate(const ByteArray& der) { - CFDataRef derData = CFDataCreateWithBytesNoCopy(NULL, der.data(), static_cast<CFIndex>(der.size()), NULL); + CFDataRef derData = CFDataCreateWithBytesNoCopy(nullptr, der.data(), static_cast<CFIndex>(der.size()), nullptr); // certificate will take ownership of derData and free it on its release. - SecCertificateRef certificate = SecCertificateCreateWithData(NULL, derData); + SecCertificateRef certificate = SecCertificateCreateWithData(nullptr, derData); if (certificate) { certificateHandle_ = boost::shared_ptr<SecCertificate>(certificate, CFRelease); parse(); @@ -64,10 +64,10 @@ SecureTransportCertificate::~SecureTransportCertificate() { void SecureTransportCertificate::parse() { assert(certificateHandle_); - CFErrorRef error = NULL; + CFErrorRef error = nullptr; // The SecCertificateCopyValues function is not part of the iOS Secure Transport API. - CFDictionaryRef valueDict = SecCertificateCopyValues(certificateHandle_.get(), 0, &error); + CFDictionaryRef valueDict = SecCertificateCopyValues(certificateHandle_.get(), nullptr, &error); if (valueDict) { // Handle subject. CFStringRef subject = SecCertificateCopySubjectSummary(certificateHandle_.get()); @@ -78,7 +78,7 @@ void SecureTransportCertificate::parse() { } // Handle a single Common Name. - CFStringRef commonName = NULL; + CFStringRef commonName = nullptr; OSStatus error = SecCertificateCopyCommonName(certificateHandle_.get(), &commonName); if (!error && commonName) { NSString* commonNameStr = bridge_cast<NSString*>(commonName); |