summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-05-06 10:58:58 +0200
committerJose <jose@zeroc.com>2019-05-06 11:00:15 +0200
commit80565ef1ebde04d37564eced4d5ee966a92cf993 (patch)
treee4b630d3d84e7892da95b2a028e2b2117d9f9d61
parentIce/hold test fixes (diff)
downloadice-80565ef1ebde04d37564eced4d5ee966a92cf993.tar.bz2
ice-80565ef1ebde04d37564eced4d5ee966a92cf993.tar.xz
ice-80565ef1ebde04d37564eced4d5ee966a92cf993.zip
Fix iOS warnings
-rw-r--r--cpp/src/Ice/ios/StreamEndpointI.cpp5
-rw-r--r--cpp/src/Ice/ios/StreamTransceiver.cpp6
-rw-r--r--cpp/src/IceIAP/Transceiver.mm4
-rw-r--r--cpp/src/IceSSL/SecureTransportTransceiverI.cpp3
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())))
{