diff options
author | Jose <jose@zeroc.com> | 2019-05-06 10:58:58 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-05-06 11:00:15 +0200 |
commit | 80565ef1ebde04d37564eced4d5ee966a92cf993 (patch) | |
tree | e4b630d3d84e7892da95b2a028e2b2117d9f9d61 | |
parent | Ice/hold test fixes (diff) | |
download | ice-80565ef1ebde04d37564eced4d5ee966a92cf993.tar.bz2 ice-80565ef1ebde04d37564eced4d5ee966a92cf993.tar.xz ice-80565ef1ebde04d37564eced4d5ee966a92cf993.zip |
Fix iOS warnings
-rw-r--r-- | cpp/src/Ice/ios/StreamEndpointI.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Ice/ios/StreamTransceiver.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceIAP/Transceiver.mm | 4 | ||||
-rw-r--r-- | cpp/src/IceSSL/SecureTransportTransceiverI.cpp | 3 |
4 files changed, 11 insertions, 7 deletions
diff --git a/cpp/src/Ice/ios/StreamEndpointI.cpp b/cpp/src/Ice/ios/StreamEndpointI.cpp index f70f47d5c3b..fdce4821b21 100644 --- a/cpp/src/Ice/ios/StreamEndpointI.cpp +++ b/cpp/src/Ice/ios/StreamEndpointI.cpp @@ -38,6 +38,7 @@ createIceTCP(const CommunicatorPtr& com, const string&, const StringSeq&) } +#if TARGET_IPHONE_SIMULATOR == 0 namespace { @@ -48,6 +49,7 @@ toCFString(const string& s) } } +#endif IceObjC::Instance::Instance(const Ice::CommunicatorPtr& com, Short type, const string& protocol, bool secure) : ProtocolInstance(com, type, protocol, secure), @@ -65,7 +67,7 @@ IceObjC::Instance::Instance(const Ice::CommunicatorPtr& com, Short type, const s { #if TARGET_IPHONE_SIMULATOR != 0 throw Ice::FeatureNotSupportedException(__FILE__, __LINE__, "SOCKS proxy not supported"); -#endif +#else _proxySettings.reset(CFDictionaryCreateMutable(0, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); @@ -78,6 +80,7 @@ IceObjC::Instance::Instance(const Ice::CommunicatorPtr& com, Short type, const s CFDictionarySetValue(_proxySettings.get(), kCFStreamPropertySOCKSProxyPort, port.get()); CFDictionarySetValue(_proxySettings.get(), kCFStreamPropertySOCKSVersion, kCFStreamSocketSOCKSVersion4); +#endif } } diff --git a/cpp/src/Ice/ios/StreamTransceiver.cpp b/cpp/src/Ice/ios/StreamTransceiver.cpp index 6a0815625b5..fc42cb948ea 100644 --- a/cpp/src/Ice/ios/StreamTransceiver.cpp +++ b/cpp/src/Ice/ios/StreamTransceiver.cpp @@ -507,7 +507,7 @@ IceObjC::StreamTransceiver::checkErrorStatus(CFWriteStreamRef writeStream, CFRea CFStringRef domain = CFErrorGetDomain(err.get()); if(CFStringCompare(domain, kCFErrorDomainPOSIX, 0) == kCFCompareEqualTo) { - errno = CFErrorGetCode(err.get()); + errno = static_cast<int>(CFErrorGetCode(err.get())); if(interrupted() || noBuffers()) { return; @@ -530,7 +530,7 @@ IceObjC::StreamTransceiver::checkErrorStatus(CFWriteStreamRef writeStream, CFRea } } - int error = CFErrorGetCode(err.get()); + CFIndex error = CFErrorGetCode(err.get()); if(error == kCFHostErrorHostNotFound || error == kCFHostErrorUnknown) { int rs = 0; @@ -545,5 +545,5 @@ IceObjC::StreamTransceiver::checkErrorStatus(CFWriteStreamRef writeStream, CFRea } throw DNSException(file, line, rs, _host); } - throw CFNetworkException(file, line, CFErrorGetCode(err.get()), fromCFString(domain)); + throw CFNetworkException(file, line, static_cast<int>(CFErrorGetCode(err.get())), fromCFString(domain)); } diff --git a/cpp/src/IceIAP/Transceiver.mm b/cpp/src/IceIAP/Transceiver.mm index 794ffa15dd4..fb3bc30107b 100644 --- a/cpp/src/IceIAP/Transceiver.mm +++ b/cpp/src/IceIAP/Transceiver.mm @@ -416,7 +416,7 @@ IceObjC::iAPTransceiver::checkErrorStatus(NSStream* stream, const char* file, in NSString* domain = [err domain]; if([domain compare:NSPOSIXErrorDomain] == NSOrderedSame) { - errno = [err code]; + errno = static_cast<int>([err code]); [err release]; if(interrupted() || noBuffers()) { @@ -445,7 +445,7 @@ IceObjC::iAPTransceiver::checkErrorStatus(NSStream* stream, const char* file, in // Otherwise throw a generic exception. CFNetworkException ex(file, line); ex.domain = [domain UTF8String]; - ex.error = [err code]; + ex.error = static_cast<int>([err code]); [err release]; throw ex; } diff --git a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp index 7c5cda6f256..00d0ad0fce5 100644 --- a/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +++ b/cpp/src/IceSSL/SecureTransportTransceiverI.cpp @@ -120,7 +120,8 @@ checkTrustResult(SecTrustRef trust, // if(engine->getCheckCertName() && !host.empty()) { - UniqueRef<SecPolicyRef> policy(SecPolicyCreateSSL(false, toCFString(host))); + UniqueRef<CFStringRef> hostref(toCFString(host)); + UniqueRef<SecPolicyRef> policy(SecPolicyCreateSSL(false, hostref.get())); UniqueRef<CFArrayRef> policies; if((err = SecTrustCopyPolicies(trust, &policies.get()))) { |