summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-06-28 22:52:03 +0000
committerBernard Normier <bernard@zeroc.com>2006-06-28 22:52:03 +0000
commit0e327a88a4640b291ee096fb31396ed4d203f636 (patch)
tree3155260ffa37d101a4dff4a9152b5a113564c643
parentfix noarch RPM dependencies (diff)
downloadice-0e327a88a4640b291ee096fb31396ed4d203f636.tar.bz2
ice-0e327a88a4640b291ee096fb31396ed4d203f636.tar.xz
ice-0e327a88a4640b291ee096fb31396ed4d203f636.zip
Port to Solaris 10 + fix for numerous warnings on Sun
-rw-r--r--cpp/CHANGES3
-rw-r--r--cpp/INSTALL.SOLARIS4
-rw-r--r--cpp/config/Make.rules.SunOS4
-rw-r--r--cpp/include/IceUtil/Config.h10
-rw-r--r--cpp/src/Glacier2/RouterI.cpp2
-rwxr-xr-xcpp/src/Ice/GC.cpp4
-rw-r--r--cpp/src/Ice/Network.cpp4
-rw-r--r--cpp/src/Ice/Reference.cpp17
-rw-r--r--cpp/src/Ice/Reference.h2
-rw-r--r--cpp/src/IceGrid/AdapterCache.cpp10
-rw-r--r--cpp/src/IceGrid/AdapterCache.h2
-rw-r--r--cpp/src/IceGrid/AllocatableObjectCache.cpp4
-rw-r--r--cpp/src/IceGrid/AllocatableObjectCache.h2
-rw-r--r--cpp/src/IceGrid/Database.cpp5
-rw-r--r--cpp/src/IceGrid/Database.h3
-rw-r--r--cpp/src/IceGrid/SessionI.cpp4
-rw-r--r--cpp/src/IceGrid/Util.h12
-rw-r--r--cpp/src/IcePatch2/Util.cpp4
-rwxr-xr-xcpp/src/IceSSL/Certificate.cpp2
-rw-r--r--cpp/src/IceSSL/Instance.cpp4
-rw-r--r--cpp/src/IceUtil/Random.cpp2
-rw-r--r--cpp/src/IceUtil/UUID.cpp2
-rw-r--r--cpp/src/slice2cpp/Main.cpp2
-rw-r--r--cpp/src/slice2cppe/Main.cpp2
-rw-r--r--cpp/src/slice2cs/Main.cpp2
-rw-r--r--cpp/src/slice2docbook/Main.cpp2
-rw-r--r--cpp/src/slice2freeze/Main.cpp2
-rw-r--r--cpp/src/slice2freezej/Main.cpp2
-rw-r--r--cpp/src/slice2java/Main.cpp2
-rw-r--r--cpp/src/slice2javae/Main.cpp2
-rw-r--r--cpp/src/slice2py/Main.cpp2
-rw-r--r--cpp/src/slice2vb/Main.cpp2
-rw-r--r--cpp/test/Ice/binding/AllTests.cpp26
-rw-r--r--cpp/test/IceGrid/allocation/AllTests.cpp2
-rw-r--r--cpp/test/IceSSL/configuration/AllTests.cpp73
-rw-r--r--cpp/test/IceSSL/configuration/TestI.cpp4
-rw-r--r--cpp/test/IceUtil/uuid/Client.cpp2
37 files changed, 127 insertions, 106 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index ba74ad93ad1..41183138529 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,9 @@
Changes since version 3.0.1
---------------------------
+- Unsupported port to Solaris 10 on Intel/AMD contributed by
+ Markus Bernhardt.
+
- Removed removeObjectFactory() from the communicator interface.
- Added a new object and server allocation mechanism to IceGrid. See
diff --git a/cpp/INSTALL.SOLARIS b/cpp/INSTALL.SOLARIS
index 198b0840ae4..b58f8fe549b 100644
--- a/cpp/INSTALL.SOLARIS
+++ b/cpp/INSTALL.SOLARIS
@@ -7,8 +7,8 @@ Operating System
----------------
Ice is expected to build and run properly on Solaris 8, Solaris 9
-and Solaris 10 on SPARC. However, Ice is officially supported
-only on Solaris 9 on SPARC.
+and Solaris 10 on SPARC and Intel/AMD64.
+However, Ice is officially supported only on Solaris 9 on SPARC.
You also need to have /dev/urandom installed. This is installed by
default on Solaris 9 and Solaris 10; on Solaris 8, you need to install
diff --git a/cpp/config/Make.rules.SunOS b/cpp/config/Make.rules.SunOS
index ce9a733c0f9..a58e5c892f8 100644
--- a/cpp/config/Make.rules.SunOS
+++ b/cpp/config/Make.rules.SunOS
@@ -60,7 +60,9 @@ ifeq ($(CXX),CC)
# -erroff=hidef is a (bad) work-around for
# for Sun CC 5.5 bug #4852754
#
- CXXWARNFLAGS = +w -erroff=hidef
+ # wvarhidenmem,wvarhidemem: various name hiding
+ #
+ CXXWARNFLAGS = +w -erroff=hidef,wvarhidenmem,wvarhidemem
CXXSCOPEFLAGS = -xldscope=hidden
endif
endif
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 3381104d864..a340171ce52 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -36,11 +36,11 @@
// the architecture
//
# define ICE_32
-#elif defined(__sun) && defined(__sparcv9) || \
- defined(__linux) && defined(__x86_64) || \
- defined(__hppa) && defined(__LP64__) || \
- defined(_ARCH_COM) && defined(__64BIT__) || \
- defined(__alpha__) || \
+#elif defined(__sun) && (defined(__sparcv9) || defined(__x86_64)) || \
+ defined(__linux) && defined(__x86_64) || \
+ defined(__hppa) && defined(__LP64__) || \
+ defined(_ARCH_COM) && defined(__64BIT__) || \
+ defined(__alpha__) || \
defined(_WIN64)
# define ICE_64
#else
diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp
index b124f1bdb41..dc86b39c1cc 100644
--- a/cpp/src/Glacier2/RouterI.cpp
+++ b/cpp/src/Glacier2/RouterI.cpp
@@ -37,7 +37,7 @@ Glacier2::RouterI::RouterI(const ObjectAdapterPtr& clientAdapter, const ObjectAd
ident.name = "dummy";
ident.category.resize(20);
char buf[20];
- IceUtil::generateRandom(buf, sizeof(buf));
+ IceUtil::generateRandom(buf, static_cast<int>(sizeof(buf)));
for(unsigned int i = 0; i < sizeof(buf); ++i)
{
const unsigned char c = static_cast<unsigned char>(buf[i]); // A value between 0-255
diff --git a/cpp/src/Ice/GC.cpp b/cpp/src/Ice/GC.cpp
index f8334d41e97..19b545ad231 100755
--- a/cpp/src/Ice/GC.cpp
+++ b/cpp/src/Ice/GC.cpp
@@ -218,10 +218,10 @@ IceInternal::GC::collectGarbage()
for(GCObjectSet::const_iterator i = liveObjects.begin(); i != liveObjects.end(); ++i)
{
#ifndef NDEBUG
- bool erased =
+ size_t erased =
#endif
counts.erase(*i);
- assert(erased);
+ assert(erased != 0);
}
}
}
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index f341f3b79de..bc917c4299c 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -1315,7 +1315,7 @@ IceInternal::getLocalHosts()
//
while(true)
{
- int bufsize = numaddrs * sizeof(struct ifreq);
+ int bufsize = numaddrs * static_cast<int>(sizeof(struct ifreq));
ifc.ifc_len = bufsize;
ifc.ifc_buf = (char*)malloc(bufsize);
@@ -1344,7 +1344,7 @@ IceInternal::getLocalHosts()
free(ifc.ifc_buf);
}
- numaddrs = ifc.ifc_len / sizeof(struct ifreq);
+ numaddrs = ifc.ifc_len / static_cast<int>(sizeof(struct ifreq));
struct ifreq* ifr = ifc.ifc_req;
for(int i = 0; i < numaddrs; ++i)
{
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 86841af06e3..6ded5007926 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -26,6 +26,8 @@
#include <IceUtil/StringUtil.h>
#include <IceUtil/Random.h>
+#include <functional>
+
using namespace std;
using namespace Ice;
using namespace IceInternal;
@@ -33,7 +35,16 @@ using namespace IceInternal;
void IceInternal::incRef(IceInternal::Reference* p) { p->__incRef(); }
void IceInternal::decRef(IceInternal::Reference* p) { p->__decRef(); }
-pointer_to_unary_function<int, int> Reference::_rand(IceUtil::random);
+namespace
+{
+struct RandomNumberGenerator : public std::unary_function<ptrdiff_t, ptrdiff_t>
+{
+ ptrdiff_t operator()(ptrdiff_t d)
+ {
+ return IceUtil::random(static_cast<int>(d));
+ }
+};
+}
CommunicatorPtr
IceInternal::Reference::getCommunicator() const
@@ -652,7 +663,7 @@ IceInternal::FixedReference::filterConnections(const vector<ConnectionIPtr>& all
//
// Randomize the order of connections.
//
- random_shuffle(connections.begin(), connections.end(), _rand);
+ random_shuffle(connections.begin(), connections.end(), RandomNumberGenerator());
//
// If a secure connection is requested, remove all non-secure
@@ -1054,7 +1065,7 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all
{
case Random:
{
- random_shuffle(endpoints.begin(), endpoints.end(), _rand);
+ random_shuffle(endpoints.begin(), endpoints.end(), RandomNumberGenerator());
break;
}
case Ordered:
diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h
index c9623a33191..8c9575fcaac 100644
--- a/cpp/src/Ice/Reference.h
+++ b/cpp/src/Ice/Reference.h
@@ -119,8 +119,6 @@ protected:
mutable Ice::Int _hashValue;
mutable bool _hashInitialized;
- static std::pointer_to_unary_function<int, int> _rand;
-
private:
const InstancePtr _instance;
diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp
index 952a58d7686..7a43d8c7d54 100644
--- a/cpp/src/IceGrid/AdapterCache.cpp
+++ b/cpp/src/IceGrid/AdapterCache.cpp
@@ -16,11 +16,11 @@
#include <IceGrid/NodeCache.h>
#include <IceGrid/SessionI.h>
+#include <functional>
+
using namespace std;
using namespace IceGrid;
-pointer_to_unary_function<int, int> ReplicaGroupEntry::_rand(IceUtil::random);
-
namespace IceGrid
{
@@ -365,14 +365,14 @@ ReplicaGroupEntry::getProxies(int& nReplicas, bool& replicaGroup)
else if(AdaptiveLoadBalancingPolicyPtr::dynamicCast(_loadBalancing))
{
replicas = _replicas;
- random_shuffle(replicas.begin(), replicas.end(), _rand);
+ random_shuffle(replicas.begin(), replicas.end(), RandomNumberGenerator());
adaptive = true;
loadSample = _loadSample;
}
else// if(RandomLoadBalancingPolicyPtr::dynamicCast(_loadBalancing))
{
replicas = _replicas;
- random_shuffle(replicas.begin(), replicas.end(), _rand);
+ random_shuffle(replicas.begin(), replicas.end(), RandomNumberGenerator());
}
}
@@ -439,7 +439,7 @@ ReplicaGroupEntry::getLeastLoadedNodeLoad(LoadSample loadSample) const
// This must be done outside the synchronization block since
// min_element() will call and lock each server entry.
//
- random_shuffle(replicas.begin(), replicas.end(), _rand);
+ random_shuffle(replicas.begin(), replicas.end(), RandomNumberGenerator());
vector<ReplicaLoadComp::ReplicaLoad> rl;
transform(replicas.begin(), replicas.end(), back_inserter(rl), ToReplicaLoad(loadSample));
AdapterEntryPtr adpt = min_element(rl.begin(), rl.end(), ReplicaLoadComp())->second.second;
diff --git a/cpp/src/IceGrid/AdapterCache.h b/cpp/src/IceGrid/AdapterCache.h
index aa17a733f2e..b5fdc7958b2 100644
--- a/cpp/src/IceGrid/AdapterCache.h
+++ b/cpp/src/IceGrid/AdapterCache.h
@@ -98,8 +98,6 @@ private:
LoadSample _loadSample;
ReplicaSeq _replicas;
int _lastReplica;
-
- static std::pointer_to_unary_function<int, int> _rand;
};
typedef IceUtil::Handle<ReplicaGroupEntry> ReplicaGroupEntryPtr;
diff --git a/cpp/src/IceGrid/AllocatableObjectCache.cpp b/cpp/src/IceGrid/AllocatableObjectCache.cpp
index b13d8175bb5..f5275da7e43 100644
--- a/cpp/src/IceGrid/AllocatableObjectCache.cpp
+++ b/cpp/src/IceGrid/AllocatableObjectCache.cpp
@@ -17,8 +17,6 @@
using namespace std;
using namespace IceGrid;
-pointer_to_unary_function<int, int> AllocatableObjectCache::_rand(IceUtil::random);
-
namespace IceGrid
{
@@ -198,7 +196,7 @@ AllocatableObjectCache::allocateByType(const string& type, const ObjectAllocatio
}
vector<AllocatableObjectEntryPtr> objects = p->second.getObjects();
- random_shuffle(objects.begin(), objects.end(), _rand); // TODO: OPTIMIZE
+ random_shuffle(objects.begin(), objects.end(), RandomNumberGenerator()); // TODO: OPTIMIZE
try
{
for(vector<AllocatableObjectEntryPtr>::const_iterator q = objects.begin(); q != objects.end(); ++q)
diff --git a/cpp/src/IceGrid/AllocatableObjectCache.h b/cpp/src/IceGrid/AllocatableObjectCache.h
index 9779314dd54..db5805836df 100644
--- a/cpp/src/IceGrid/AllocatableObjectCache.h
+++ b/cpp/src/IceGrid/AllocatableObjectCache.h
@@ -111,8 +111,6 @@ private:
const Ice::CommunicatorPtr _communicator;
std::map<std::string, TypeEntry> _types;
std::map<std::string, std::vector<Ice::Identity> > _allocatablesByType;
-
- static std::pointer_to_unary_function<int, int> _rand;
};
};
diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp
index 523d6ec077c..251745fafb2 100644
--- a/cpp/src/IceGrid/Database.cpp
+++ b/cpp/src/IceGrid/Database.cpp
@@ -27,7 +27,6 @@ using namespace IceGrid;
const string Database::_descriptorDbName = "applications";
const string Database::_adapterDbName = "adapters";
const string Database::_objectDbName = "objects";
-pointer_to_unary_function<int, int> Database::_rand(IceUtil::random);
namespace IceGrid
{
@@ -810,7 +809,7 @@ Database::getAdapters(const string& id, int& endpointCount, bool& replicaGroup)
adpts.push_back(make_pair(p->first, adpt));
++p;
}
- random_shuffle(adpts.begin(), adpts.end(), _rand);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
replicaGroup = true;
endpointCount = static_cast<int>(adpts.size());
return adpts;
@@ -1073,7 +1072,7 @@ Ice::ObjectPrx
Database::getObjectByTypeOnLeastLoadedNode(const string& type, LoadSample sample)
{
Ice::ObjectProxySeq objs = getObjectsByType(type);
- random_shuffle(objs.begin(), objs.end(), _rand);
+ random_shuffle(objs.begin(), objs.end(), RandomNumberGenerator());
vector<pair<Ice::ObjectPrx, float> > objectsWithLoad;
objectsWithLoad.reserve(objs.size());
for(Ice::ObjectProxySeq::const_iterator p = objs.begin(); p != objs.end(); ++p)
diff --git a/cpp/src/IceGrid/Database.h b/cpp/src/IceGrid/Database.h
index 580e74d6a05..49cf5be1cfc 100644
--- a/cpp/src/IceGrid/Database.h
+++ b/cpp/src/IceGrid/Database.h
@@ -128,8 +128,7 @@ private:
static const std::string _objectDbName;
static const std::string _adapterDbName;
static const std::string _replicaGroupDbName;
- static std::pointer_to_unary_function<int, int> _rand;
-
+
const Ice::CommunicatorPtr _communicator;
const Ice::ObjectAdapterPtr _internalAdapter;
const std::string _envName;
diff --git a/cpp/src/IceGrid/SessionI.cpp b/cpp/src/IceGrid/SessionI.cpp
index 0c3b45896a5..d6e608f1049 100644
--- a/cpp/src/IceGrid/SessionI.cpp
+++ b/cpp/src/IceGrid/SessionI.cpp
@@ -55,13 +55,13 @@ private:
TPtr _cb;
};
-template<class T> static AllocateObject<T>*
+template<class T> AllocateObject<T>*
newAllocateObject(const SessionIPtr& session, const IceUtil::Handle<T>& cb)
{
return new AllocateObject<T>(session, cb);
}
-};
+}
BaseSessionI::BaseSessionI(const string& id,
const string& prefix,
diff --git a/cpp/src/IceGrid/Util.h b/cpp/src/IceGrid/Util.h
index d2196853427..c7f6ed142a3 100644
--- a/cpp/src/IceGrid/Util.h
+++ b/cpp/src/IceGrid/Util.h
@@ -13,10 +13,22 @@
#include <IceGrid/Descriptor.h>
#include <IceUtil/StringUtil.h>
#include <IceGrid/Exception.h>
+#include <IceUtil/Random.h>
+
+#include <functional>
namespace IceGrid
{
+struct RandomNumberGenerator : public std::unary_function<ptrdiff_t, ptrdiff_t>
+{
+ ptrdiff_t operator()(ptrdiff_t d)
+ {
+ return IceUtil::random(static_cast<int>(d));
+ }
+};
+
+
template<typename T> std::insert_iterator<T>
inline set_inserter(T& container)
{
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp
index b16203054fa..d8522353f21 100644
--- a/cpp/src/IcePatch2/Util.cpp
+++ b/cpp/src/IcePatch2/Util.cpp
@@ -125,7 +125,7 @@ IcePatch2::readFileInfo(FILE* fp, FileInfo& info)
{
string data;
char buf[BUFSIZ];
- while(fgets(buf, sizeof(buf), fp) != 0)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), fp) != 0)
{
data += buf;
@@ -971,7 +971,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G
}
}
- unsigned int bytesLeft = buf.st_size;
+ unsigned int bytesLeft = static_cast<unsigned int>(buf.st_size);
while(bytesLeft > 0)
{
ByteSeq bytes(min(bytesLeft, 1024u*1024));
diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp
index 15e03fbe49b..030f798042a 100755
--- a/cpp/src/IceSSL/Certificate.cpp
+++ b/cpp/src/IceSSL/Certificate.cpp
@@ -518,7 +518,7 @@ Certificate::getSubjectAlternativeNames()
int
Certificate::getVersion() const
{
- return X509_get_version(_cert);
+ return static_cast<int>(X509_get_version(_cert));
}
string
diff --git a/cpp/src/IceSSL/Instance.cpp b/cpp/src/IceSSL/Instance.cpp
index fd3e2b3324d..8e9f97d62a7 100644
--- a/cpp/src/IceSSL/Instance.cpp
+++ b/cpp/src/IceSSL/Instance.cpp
@@ -786,9 +786,9 @@ IceSSL::Instance::verifyCallback(int ok, SSL* ssl, X509_STORE_CTX* c)
Trace out(_logger, _securityTraceCategory);
out << "certificate verification failure\n";
- X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf));
+ X509_NAME_oneline(X509_get_issuer_name(cert), buf, static_cast<int>(sizeof(buf)));
out << "issuer = " << buf << '\n';
- X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf));
+ X509_NAME_oneline(X509_get_subject_name(cert), buf, static_cast<int>(sizeof(buf)));
out << "subject = " << buf << '\n';
out << "depth = " << X509_STORE_CTX_get_error_depth(c) << '\n';
out << "error = " << X509_verify_cert_error_string(err) << '\n';
diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp
index f2927d35f64..3daec473553 100644
--- a/cpp/src/IceUtil/Random.cpp
+++ b/cpp/src/IceUtil/Random.cpp
@@ -208,7 +208,7 @@ int
IceUtil::random(int limit)
{
int r;
- generateRandom(reinterpret_cast<char*>(&r), sizeof(int));
+ generateRandom(reinterpret_cast<char*>(&r), static_cast<int>(sizeof(int)));
if(limit > 0)
{
r = r % limit;
diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp
index 0f1c9a905b8..de9618b1c3f 100644
--- a/cpp/src/IceUtil/UUID.cpp
+++ b/cpp/src/IceUtil/UUID.cpp
@@ -112,7 +112,7 @@ IceUtil::generateUUID()
// Randoms by the last 15 bits of the process id.
//
char* buffer = reinterpret_cast<char*>(&uuid);
- generateRandom(buffer, sizeof(UUID));
+ generateRandom(buffer, static_cast<int>(sizeof(UUID)));
//
// Adjust the bits that say "version 4" UUID
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 21567e366fb..7a59173d5e4 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -183,7 +183,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2cppe/Main.cpp b/cpp/src/slice2cppe/Main.cpp
index c9261337313..125e72f43ab 100644
--- a/cpp/src/slice2cppe/Main.cpp
+++ b/cpp/src/slice2cppe/Main.cpp
@@ -174,7 +174,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp
index 63d1d74ad63..4c42f058052 100644
--- a/cpp/src/slice2cs/Main.cpp
+++ b/cpp/src/slice2cs/Main.cpp
@@ -171,7 +171,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp
index a4a79ccd923..cbce4b99090 100644
--- a/cpp/src/slice2docbook/Main.cpp
+++ b/cpp/src/slice2docbook/Main.cpp
@@ -171,7 +171,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index 992289e0f14..8c051ecdb55 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -1665,7 +1665,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index 8b0467c4708..7efb1e5aeb1 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -1397,7 +1397,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp
index 7d9f6e853d2..efa0aab8be1 100644
--- a/cpp/src/slice2java/Main.cpp
+++ b/cpp/src/slice2java/Main.cpp
@@ -185,7 +185,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2javae/Main.cpp b/cpp/src/slice2javae/Main.cpp
index c3be420adc5..3cace01643f 100644
--- a/cpp/src/slice2javae/Main.cpp
+++ b/cpp/src/slice2javae/Main.cpp
@@ -164,7 +164,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp
index 9fe1b0a8974..5b625547355 100644
--- a/cpp/src/slice2py/Main.cpp
+++ b/cpp/src/slice2py/Main.cpp
@@ -496,7 +496,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/src/slice2vb/Main.cpp b/cpp/src/slice2vb/Main.cpp
index 8c015418e80..60d7591057b 100644
--- a/cpp/src/slice2vb/Main.cpp
+++ b/cpp/src/slice2vb/Main.cpp
@@ -172,7 +172,7 @@ main(int argc, char* argv[])
if(preprocess)
{
char buf[4096];
- while(fgets(buf, sizeof(buf), cppHandle) != NULL)
+ while(fgets(buf, static_cast<int>(sizeof(buf)), cppHandle) != NULL)
{
if(fputs(buf, stdout) == EOF)
{
diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp
index 0d0b035baaa..d22c91e23f3 100644
--- a/cpp/test/Ice/binding/AllTests.cpp
+++ b/cpp/test/Ice/binding/AllTests.cpp
@@ -12,10 +12,18 @@
#include <TestCommon.h>
#include <Test.h>
+#include <functional>
+
using namespace std;
using namespace Test;
-static pointer_to_unary_function<int, int> randomGenerator(IceUtil::random);
+struct RandomNumberGenerator : public std::unary_function<ptrdiff_t, ptrdiff_t>
+{
+ ptrdiff_t operator()(ptrdiff_t d)
+ {
+ return IceUtil::random(static_cast<int>(d));
+ }
+};
class GetAdapterNameCB : public AMI_TestIntf_getAdapterName, public IceUtil::Monitor<IceUtil::Mutex>
{
@@ -138,9 +146,9 @@ allTests(const Ice::CommunicatorPtr& communicator)
vector<RemoteObjectAdapterPrx> adpts = adapters;
TestIntfPrx test1 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test2 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test3 = createTestIntfPrx(adpts);
test(test1->ice_getConnection() == test2->ice_getConnection());
@@ -185,9 +193,9 @@ allTests(const Ice::CommunicatorPtr& communicator)
vector<RemoteObjectAdapterPrx> adpts = adapters;
TestIntfPrx test1 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test2 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test3 = createTestIntfPrx(adpts);
test(test1->ice_getConnection() == test2->ice_getConnection());
@@ -229,9 +237,9 @@ allTests(const Ice::CommunicatorPtr& communicator)
vector<RemoteObjectAdapterPrx> adpts = adapters;
TestIntfPrx test1 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test2 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test3 = createTestIntfPrx(adpts);
test(test1->ice_getConnection() == test2->ice_getConnection());
@@ -276,9 +284,9 @@ allTests(const Ice::CommunicatorPtr& communicator)
vector<RemoteObjectAdapterPrx> adpts = adapters;
TestIntfPrx test1 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test2 = createTestIntfPrx(adpts);
- random_shuffle(adpts.begin(), adpts.end(), randomGenerator);
+ random_shuffle(adpts.begin(), adpts.end(), RandomNumberGenerator());
TestIntfPrx test3 = createTestIntfPrx(adpts);
test(test1->ice_getConnection() == test2->ice_getConnection());
diff --git a/cpp/test/IceGrid/allocation/AllTests.cpp b/cpp/test/IceGrid/allocation/AllTests.cpp
index 6f2db328b9d..e91244af07d 100644
--- a/cpp/test/IceGrid/allocation/AllTests.cpp
+++ b/cpp/test/IceGrid/allocation/AllTests.cpp
@@ -47,7 +47,7 @@ public:
}
void
- waitResponse(char* file, int line)
+ waitResponse(const char* file, int line)
{
Lock sync(*this);
while(!_response && !_exception)
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp
index abdf71629ec..f733629fdcd 100644
--- a/cpp/test/IceSSL/configuration/AllTests.cpp
+++ b/cpp/test/IceSSL/configuration/AllTests.cpp
@@ -150,15 +150,12 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
string sep = ":";
#endif
- int argc = 0;
- char* argv[] = { "" };
-
cout << "testing manual initialization... " << flush;
{
InitializationData initData;
initData.properties = createClientProps(defaultHost);
initData.properties->setProperty("Ice.InitPlugins", "0");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
ObjectPrx p = comm->stringToProxy("dummy:ssl -p 9999");
try
{
@@ -181,7 +178,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("Ice.InitPlugins", "0");
initData.properties->setProperty("IceSSL.Ciphers", "ADH");
initData.properties->setProperty("IceSSL.VerifyPeer", "0");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
PluginManagerPtr pm = comm->getPluginManager();
pm->initializePlugins();
ObjectPrx obj = comm->stringToProxy(factoryRef);
@@ -215,7 +212,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.VerifyPeer", "0");
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.DefaultDir", defaultDir);
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -306,7 +303,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
//
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -399,7 +396,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert2.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca2_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca2_priv.pem");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -439,7 +436,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca2_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca2_priv.pem");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -483,7 +480,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties = createClientProps(defaultHost);
initData.properties->setProperty("IceSSL.Ciphers", "ADH");
initData.properties->setProperty("IceSSL.VerifyPeer", "0");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
CertificateVerifierIPtr verifier = new CertificateVerifierI;
@@ -546,7 +543,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.VerifyPeer", "0");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
CertificateVerifierIPtr verifier = new CertificateVerifierI;
@@ -587,7 +584,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.Ciphers", "ADH");
initData.properties->setProperty("IceSSL.VerifyPeer", "0");
initData.properties->setProperty("IceSSL.Protocols", "ssl3");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -618,7 +615,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
//
// This should succeed.
//
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -656,7 +653,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -698,7 +695,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
}
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_exp_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_exp_priv.pem");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -743,7 +740,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.DefaultDir", defaultDir);
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -776,7 +773,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_pass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_pass_ca1_priv.pem");
initData.properties->setProperty("Ice.InitPlugins", "0");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
PluginManagerPtr pm = comm->getPluginManager();
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(pm->getPlugin("IceSSL"));
test(plugin);
@@ -812,7 +809,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_pass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.PasswordRetryMax", "4");
initData.properties->setProperty("Ice.InitPlugins", "0");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
pm = comm->getPluginManager();
plugin = IceSSL::PluginPtr::dynamicCast(pm->getPlugin("IceSSL"));
test(plugin);
@@ -845,7 +842,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
InitializationData initData;
initData.properties = createClientProps(defaultHost);
initData.properties->setProperty("IceSSL.Ciphers", "ADH");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -881,7 +878,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_dsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_dsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.Ciphers", "DEFAULT:DSS");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -909,7 +906,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.DefaultDir", defaultDir);
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -935,7 +932,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
//
initData.properties = createClientProps(defaultHost);
initData.properties->setProperty("IceSSL.Ciphers", "ADH");
- comm = initialize(argc, argv, initData);
+ comm = initialize(initData);
fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
d = createServerProps(defaultHost);
@@ -971,7 +968,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_dsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_dsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.Ciphers", "DSS");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
Test::ServerFactoryPrx fact = Test::ServerFactoryPrx::checkedCast(comm->stringToProxy(factoryRef));
test(fact);
Test::Properties d = createServerProps(defaultHost);
@@ -1014,7 +1011,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "C=US, ST=Florida, O=ZeroC\\, Inc.,"
"OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1046,7 +1043,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "C=US, ST=Florida, O=\"ZeroC, Inc.\","
"OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1077,7 +1074,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1110,7 +1107,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1141,7 +1138,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1173,7 +1170,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "CN=Client");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1204,7 +1201,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1236,7 +1233,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "C=Canada,CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1267,7 +1264,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly", "C=Canada;CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1302,7 +1299,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly.Client", "C=US, ST=Florida, O=ZeroC\\, Inc.,"
"OU=Ice, emailAddress=info@zeroc.com, CN=Server");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1336,7 +1333,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
initData.properties->setProperty("IceSSL.TrustOnly.Client", "CN=Client");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1372,7 +1369,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
// Should have no effect.
initData.properties->setProperty("IceSSL.TrustOnly.Server", "C=US, ST=Florida, O=ZeroC\\, Inc., OU=Ice,"
"emailAddress=info@zeroc.com,CN=Client");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1404,7 +1401,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1438,7 +1435,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
@@ -1471,7 +1468,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir)
initData.properties->setProperty("IceSSL.CertAuthFile", "cacert1.pem");
initData.properties->setProperty("IceSSL.CertFile", "c_rsa_nopass_ca1_pub.pem");
initData.properties->setProperty("IceSSL.KeyFile", "c_rsa_nopass_ca1_priv.pem");
- CommunicatorPtr comm = initialize(argc, argv, initData);
+ CommunicatorPtr comm = initialize(initData);
IceSSL::PluginPtr plugin = IceSSL::PluginPtr::dynamicCast(comm->getPluginManager()->getPlugin("IceSSL"));
test(plugin);
diff --git a/cpp/test/IceSSL/configuration/TestI.cpp b/cpp/test/IceSSL/configuration/TestI.cpp
index c49413d3fa1..28e1b4bb3ff 100644
--- a/cpp/test/IceSSL/configuration/TestI.cpp
+++ b/cpp/test/IceSSL/configuration/TestI.cpp
@@ -81,9 +81,7 @@ ServerFactoryI::createServer(const Test::Properties& props, const Current& curre
initData.properties->setProperty(p->first, p->second);
}
- int argc = 0;
- char* argv[] = { "" };
- CommunicatorPtr communicator = initialize(argc, argv, initData);
+ CommunicatorPtr communicator = initialize(initData);
ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("ServerAdapter", "ssl");
ServerIPtr server = new ServerI(communicator);
ObjectPrx obj = adapter->addWithUUID(server);
diff --git a/cpp/test/IceUtil/uuid/Client.cpp b/cpp/test/IceUtil/uuid/Client.cpp
index 229962d3ddb..345f0f3c3d3 100644
--- a/cpp/test/IceUtil/uuid/Client.cpp
+++ b/cpp/test/IceUtil/uuid/Client.cpp
@@ -92,7 +92,7 @@ struct GenerateRandomString
string s;
s.resize(20);
char buf[20];
- IceUtil::generateRandom(buf, sizeof(buf));
+ IceUtil::generateRandom(buf, static_cast<int>(sizeof(buf)));
for(unsigned int i = 0; i < sizeof(buf); ++i)
{
s[i] = 33 + buf[i] % (127-33); // We use ASCII 33-126 (from ! to ~, w/o space).