diff options
author | Bernard Normier <bernard@zeroc.com> | 2005-11-21 16:32:10 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2005-11-21 16:32:10 +0000 |
commit | deda1e21772f8efcaf91baab3a9e896c471b0f32 (patch) | |
tree | af0c168df9becd8ea00db08afb7fc04bf46dd9cd /cpp/src | |
parent | Fixed dependencies (diff) | |
download | ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.tar.bz2 ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.tar.xz ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.zip |
Windows x64 port
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/FreezeScript/Data.cpp | 6 | ||||
-rw-r--r-- | cpp/src/FreezeScript/Scanner.l | 10 | ||||
-rwxr-xr-x | cpp/src/Ice/EventLoggerI.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Ice/Network.cpp | 16 | ||||
-rwxr-xr-x | cpp/src/Ice/Service.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/TcpTransceiver.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/UdpTransceiver.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/AdapterCache.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceGrid/AdminI.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/Database.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/Scanner.l | 10 | ||||
-rw-r--r-- | cpp/src/IcePatch2/FileServerI.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IcePatch2/Util.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslAcceptor.cpp | 3 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslConnector.cpp | 3 | ||||
-rw-r--r-- | cpp/src/IceSSL/SslTransceiver.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceStorm/Scanner.l | 10 | ||||
-rw-r--r-- | cpp/src/IceUtil/InputUtil.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Slice/Scanner.l | 15 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 4 |
22 files changed, 87 insertions, 56 deletions
diff --git a/cpp/src/FreezeScript/Data.cpp b/cpp/src/FreezeScript/Data.cpp index 81dad802b9e..564cd0f8925 100644 --- a/cpp/src/FreezeScript/Data.cpp +++ b/cpp/src/FreezeScript/Data.cpp @@ -858,10 +858,10 @@ string FreezeScript::IntegerData::toString(Ice::Long value) { char buf[64]; -#ifdef ICE_64 - sprintf(buf, "%ld", value); -#elif defined(_WIN32) +#if defined(_WIN32) sprintf(buf, "%I64d", value); +#elif defined(ICE_64) + sprintf(buf, "%ld", value); #else sprintf(buf, "%lld", value); #endif diff --git a/cpp/src/FreezeScript/Scanner.l b/cpp/src/FreezeScript/Scanner.l index 7756998a2bc..9e5cdba4cf8 100644 --- a/cpp/src/FreezeScript/Scanner.l +++ b/cpp/src/FreezeScript/Scanner.l @@ -18,10 +18,12 @@ #include <map> -#ifdef _MSC_VER - // I get these warnings from some flex versions: - // warning C4003: not enough actual parameters for macro 'yywrap' -# pragma warning( disable : 4003 ) +#if defined(_MSC_VER) && defined(ICE_64) +// +// 'initializing' : conversion from '__int64' to 'int', possible loss of data +// Puts a pointer-difference into an int +// +# pragma warning( 4 : 4244 ) #endif using namespace std; diff --git a/cpp/src/Ice/EventLoggerI.cpp b/cpp/src/Ice/EventLoggerI.cpp index e0528108c31..1b738715ccd 100755 --- a/cpp/src/Ice/EventLoggerI.cpp +++ b/cpp/src/Ice/EventLoggerI.cpp @@ -69,7 +69,8 @@ Ice::EventLoggerI::EventLoggerI(const string& appName) : // The event resources are bundled into this DLL, therefore the // "EventMessageFile" key should contain the path to this DLL. // - err = RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, (unsigned char*)path, strlen(path) + 1); + err = RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, + (unsigned char*)path, static_cast<DWORD>(strlen(path) + 1)); if(err != ERROR_SUCCESS) { RegCloseKey(hKey); diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 74d8d771fec..a0d46240f66 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -712,7 +712,11 @@ repeatConnect: SOCKET IceInternal::doAccept(SOCKET fd, int timeout) { +#ifdef _WIN32 + SOCKET ret; +#else int ret; +#endif repeatAccept: if((ret = ::accept(fd, 0, 0)) == INVALID_SOCKET) @@ -734,11 +738,11 @@ repeatAccept: struct timeval tv; tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000; - rs = ::select(fd + 1, &fdSet, 0, 0, &tv); + rs = ::select(static_cast<int>(fd + 1), &fdSet, 0, 0, &tv); } else { - rs = ::select(fd + 1, &fdSet, 0, 0, 0); + rs = ::select(static_cast<int>(fd + 1), &fdSet, 0, 0, 0); } if(rs == SOCKET_ERROR) @@ -1447,7 +1451,9 @@ IceInternal::getLocalAddresses() vector<unsigned char> buffer; buffer.resize(1024); unsigned long len = 0; - DWORD rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, &buffer[0], buffer.size(), &len, 0, 0); + DWORD rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, + &buffer[0], static_cast<DWORD>(buffer.size()), + &len, 0, 0); if(rs == SOCKET_ERROR) { // @@ -1457,7 +1463,9 @@ IceInternal::getLocalAddresses() if(getSocketErrno() == WSAEFAULT) { buffer.resize(len); - rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, &buffer[0], buffer.size(), &len, 0, 0); + rs = WSAIoctl(fd, SIO_ADDRESS_LIST_QUERY, 0, 0, + &buffer[0], static_cast<DWORD>(buffer.size()), + &len, 0, 0); } if(rs == SOCKET_ERROR) diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp index 1b5ec82669d..d24c59ee640 100755 --- a/cpp/src/Ice/Service.cpp +++ b/cpp/src/Ice/Service.cpp @@ -750,7 +750,7 @@ Ice::Service::startService(const string& name, const vector<string>& args) // in argv[0], so the argv that is passed to StartService() must *not* include the // the service name in argv[0]. // - const int argc = args.size(); + const int argc = static_cast<int>(args.size()); LPCSTR* argv = new LPCSTR[argc]; int i = 0; for(vector<string>::const_iterator p = args.begin(); p != args.end(); ++p) @@ -1264,7 +1264,7 @@ Ice::Service::serviceMain(int argc, char* argv[]) { args[i++] = argv[j]; } - argc += _serviceArgs.size(); + argc += static_cast<int>(_serviceArgs.size()); // // If we can't initialize a communicator, then stop immediately. diff --git a/cpp/src/Ice/TcpTransceiver.cpp b/cpp/src/Ice/TcpTransceiver.cpp index 03bdfce556d..1eb24c27f5d 100644 --- a/cpp/src/Ice/TcpTransceiver.cpp +++ b/cpp/src/Ice/TcpTransceiver.cpp @@ -129,11 +129,11 @@ IceInternal::TcpTransceiver::write(Buffer& buf, int timeout) struct timeval tv; tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000; - rs = ::select(_fd + 1, 0, &_wFdSet, 0, &tv); + rs = ::select(static_cast<int>(_fd + 1), 0, &_wFdSet, 0, &tv); } else { - rs = ::select(_fd + 1, 0, &_wFdSet, 0, 0); + rs = ::select(static_cast<int>(_fd + 1), 0, &_wFdSet, 0, 0); } if(rs == SOCKET_ERROR) @@ -245,11 +245,11 @@ IceInternal::TcpTransceiver::read(Buffer& buf, int timeout) struct timeval tv; tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout - tv.tv_sec * 1000) * 1000; - rs = ::select(_fd + 1, &_rFdSet, 0, 0, &tv); + rs = ::select(static_cast<int>(_fd + 1), &_rFdSet, 0, 0, &tv); } else { - rs = ::select(_fd + 1, &_rFdSet, 0, 0, 0); + rs = ::select(static_cast<int>(_fd + 1), &_rFdSet, 0, 0, 0); } if(rs == SOCKET_ERROR) diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 40e132ae4d8..4ea369ed0b0 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -336,11 +336,11 @@ IceInternal::ThreadPool::run() struct timeval tv; tv.tv_sec = _timeout; tv.tv_usec = 0; - ret = ::select(_maxFd + 1, &fdSet, 0, 0, &tv); + ret = ::select(static_cast<int>(_maxFd + 1), &fdSet, 0, 0, &tv); } else { - ret = ::select(_maxFd + 1, &fdSet, 0, 0, 0); + ret = ::select(static_cast<int>(_maxFd + 1), &fdSet, 0, 0, 0); } if(ret == SOCKET_ERROR) diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp index 95e8e782890..0ac5c291705 100644 --- a/cpp/src/Ice/UdpTransceiver.cpp +++ b/cpp/src/Ice/UdpTransceiver.cpp @@ -94,8 +94,14 @@ IceInternal::UdpTransceiver::write(Buffer& buf, int) repeat: assert(_fd != INVALID_SOCKET); - ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&buf.b[0]), buf.b.size(), 0); - +#ifdef _WIN32 + ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&buf.b[0]), + static_cast<int>(buf.b.size()), 0); +#else + ssize_t ret = ::send(_fd, reinterpret_cast<const char*>(&buf.b[0]), + buf.b.size(), 0); +#endif + if(ret == SOCKET_ERROR) { if(interrupted()) @@ -109,7 +115,7 @@ repeat: assert(_fd != INVALID_SOCKET); FD_SET(_fd, &_wFdSet); - int rs = ::select(_fd + 1, 0, &_wFdSet, 0, 0); + int rs = ::select(static_cast<int>(_fd + 1), 0, &_wFdSet, 0, 0); if(rs == SOCKET_ERROR) { @@ -225,7 +231,7 @@ repeat: assert(_fd != INVALID_SOCKET); FD_SET(_fd, &_rFdSet); - int rs = ::select(_fd + 1, &_rFdSet, 0, 0, 0); + int rs = ::select(static_cast<int>(_fd + 1), &_rFdSet, 0, 0, 0); if(rs == SOCKET_ERROR) { diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 36263460338..b852e5de5b1 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -1033,7 +1033,7 @@ Activator::terminationListener() // // Wait for a child to terminate, or the interrupt event to be signaled. // - DWORD ret = WaitForMultipleObjects(handles.size(), &handles[0], FALSE, INFINITE); + DWORD ret = WaitForMultipleObjects(static_cast<DWORD>(handles.size()), &handles[0], FALSE, INFINITE); if(ret == WAIT_FAILED) { SyscallException ex(__FILE__, __LINE__); diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index 73d09fc2324..a0fec791e89 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -295,7 +295,7 @@ ReplicaGroupEntry::removeReplica(const string& replicaId) { _replicas.erase(p); // Make sure _lastReplica is still within the bounds. - _lastReplica = _replicas.empty() ? 0 : _lastReplica % _replicas.size(); + _lastReplica = _replicas.empty() ? 0 : _lastReplica % static_cast<int>(_replicas.size()); break; } } @@ -314,7 +314,7 @@ ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas) return vector<pair<string, AdapterPrx> >(); } - nReplicas = _loadBalancingNReplicas > 0 ? _loadBalancingNReplicas : _replicas.size(); + nReplicas = _loadBalancingNReplicas > 0 ? _loadBalancingNReplicas : static_cast<int>(_replicas.size()); replicas.reserve(_replicas.size()); if(!_loadBalancing) { @@ -326,7 +326,7 @@ ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas) { replicas.push_back(_replicas[(_lastReplica + i) % _replicas.size()]); } - _lastReplica = (_lastReplica + 1) % _replicas.size(); + _lastReplica = (_lastReplica + 1) % static_cast<int>(_replicas.size()); } else if(AdaptiveLoadBalancingPolicyPtr::dynamicCast(_loadBalancing)) { diff --git a/cpp/src/IceGrid/AdminI.cpp b/cpp/src/IceGrid/AdminI.cpp index 1e3a31f8b4b..09ed622c98a 100644 --- a/cpp/src/IceGrid/AdminI.cpp +++ b/cpp/src/IceGrid/AdminI.cpp @@ -321,7 +321,7 @@ AdminI::patchApplication_async(const AMD_Admin_patchApplicationPtr& amdCB, return; } - PatchAggregatorPtr aggregator = new PatchAggregator(amdCB, _traceLevels, name, nodes.size()); + PatchAggregatorPtr aggregator = new PatchAggregator(amdCB, _traceLevels, name, static_cast<int>(nodes.size())); for(vector<string>::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { if(_traceLevels->patch > 0) diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 226b84a5f9b..239fa302ba5 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -760,7 +760,7 @@ Database::getAdapters(const string& id, bool allRegistered, int& endpointCount) ++p; } random_shuffle(adpts.begin(), adpts.end()); - endpointCount = adpts.size(); + endpointCount = static_cast<int>(adpts.size()); return adpts; } diff --git a/cpp/src/IceGrid/Scanner.l b/cpp/src/IceGrid/Scanner.l index b1ef212e435..7dac72780b2 100644 --- a/cpp/src/IceGrid/Scanner.l +++ b/cpp/src/IceGrid/Scanner.l @@ -13,10 +13,12 @@ #include <IceGrid/Parser.h> #include <IceGrid/Grammar.h> -#ifdef _MSC_VER -// I get these warnings from some flex versions: -// warning C4003: not enough actual parameters for macro 'yywrap' -# pragma warning( disable : 4003 ) +#if defined(_MSC_VER) && defined(ICE_64) +// +// 'initializing' : conversion from '__int64' to 'int', possible loss of data +// Puts a pointer-difference into an int +// +# pragma warning( 4 : 4244 ) #endif using namespace std; diff --git a/cpp/src/IcePatch2/FileServerI.cpp b/cpp/src/IcePatch2/FileServerI.cpp index bb7ef6d203f..eac1790deba 100644 --- a/cpp/src/IcePatch2/FileServerI.cpp +++ b/cpp/src/IcePatch2/FileServerI.cpp @@ -112,11 +112,12 @@ IcePatch2::FileServerI::getFileCompressed(const string& pa, Int pos, Int num, co ByteSeq bytes(num); #ifdef _WIN32 - long r; + int r; + if((r = read(fd, &bytes[0], static_cast<unsigned int>(num))) == -1) #else ssize_t r; -#endif if((r = read(fd, &bytes[0], static_cast<size_t>(num))) == -1) +#endif { close(fd); diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index ed7a287b555..95479095586 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -465,7 +465,7 @@ IcePatch2::readDirectory(const string& pa) #ifdef _WIN32 struct _finddata_t data; - long h = _findfirst(simplify((path + "/*")).c_str(), &data); + intptr_t h = _findfirst(simplify((path + "/*")).c_str(), &data); if(h == -1) { throw "cannot read directory `" + path + "':\n" + lastError(); diff --git a/cpp/src/IceSSL/SslAcceptor.cpp b/cpp/src/IceSSL/SslAcceptor.cpp index 6f64ca93085..be71e036a22 100644 --- a/cpp/src/IceSSL/SslAcceptor.cpp +++ b/cpp/src/IceSSL/SslAcceptor.cpp @@ -71,7 +71,8 @@ IceSSL::SslAcceptor::accept(int timeout) out << "accepted ssl connection\n" << fdToString(fd); } - return _plugin->createServerTransceiver(fd, timeout); + return _plugin->createServerTransceiver( + static_cast<int>(fd), timeout); } void diff --git a/cpp/src/IceSSL/SslConnector.cpp b/cpp/src/IceSSL/SslConnector.cpp index 1cdfd2d8ced..0bae4ae16a9 100644 --- a/cpp/src/IceSSL/SslConnector.cpp +++ b/cpp/src/IceSSL/SslConnector.cpp @@ -38,7 +38,8 @@ IceSSL::SslConnector::connect(int timeout) out << "ssl connection established\n" << fdToString(fd); } - return _plugin->createClientTransceiver(fd, timeout); + return _plugin->createClientTransceiver( + static_cast<int>(fd), timeout); } string diff --git a/cpp/src/IceSSL/SslTransceiver.cpp b/cpp/src/IceSSL/SslTransceiver.cpp index d7c0b62a173..d01c1cd60c2 100644 --- a/cpp/src/IceSSL/SslTransceiver.cpp +++ b/cpp/src/IceSSL/SslTransceiver.cpp @@ -756,22 +756,22 @@ IceSSL::SslTransceiver::select(int timeout, bool write) { if(write) { - ret = ::select(fd + 1, 0, &rwFdSet, 0, &tv); + ret = ::select(static_cast<int>(fd + 1), 0, &rwFdSet, 0, &tv); } else { - ret = ::select(fd + 1, &rwFdSet, 0, 0, &tv); + ret = ::select(static_cast<int>(fd + 1), &rwFdSet, 0, 0, &tv); } } else { if(write) { - ret = ::select(fd + 1, 0, &rwFdSet, 0, 0); + ret = ::select(static_cast<int>(fd + 1), 0, &rwFdSet, 0, 0); } else { - ret = ::select(fd + 1, &rwFdSet, 0, 0, 0); + ret = ::select(static_cast<int>(fd + 1), &rwFdSet, 0, 0, 0); } } } diff --git a/cpp/src/IceStorm/Scanner.l b/cpp/src/IceStorm/Scanner.l index e93debacfa7..67062579f57 100644 --- a/cpp/src/IceStorm/Scanner.l +++ b/cpp/src/IceStorm/Scanner.l @@ -13,10 +13,12 @@ #include <IceStorm/Parser.h> #include <IceStorm/Grammar.h> -#ifdef _MSC_VER -// I get these warnings from some flex versions: -// warning C4003: not enough actual parameters for macro 'yywrap' -# pragma warning( disable : 4003 ) +#if defined(_MSC_VER) && defined(ICE_64) +// +// 'initializing' : conversion from '__int64' to 'int', possible loss of data +// Puts a pointer-difference into an int +// +# pragma warning( 4 : 4244 ) #endif using namespace std; diff --git a/cpp/src/IceUtil/InputUtil.cpp b/cpp/src/IceUtil/InputUtil.cpp index f554acea2eb..4e0a6f59e88 100644 --- a/cpp/src/IceUtil/InputUtil.cpp +++ b/cpp/src/IceUtil/InputUtil.cpp @@ -175,14 +175,14 @@ strToInt64Impl(const char* s, char** endptr, int base) Int64 strToInt64(const char* s, char** endptr, int base) { -#if defined(ICE_64) - return strtol(s, endptr, base); -#elif defined(_WIN32) +#if defined(_WIN32) # if defined(_MSC_VER) && (_MSC_VER < 1300) return strToInt64Impl(s, endptr, base); # else return _strtoi64(s, endptr, base); # endif +#elif defined(ICE_64) + return strtol(s, endptr, base); #elif defined(__hpux) return __strtoll(s, endptr, base); #else diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 5487e8d4601..b7541770978 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -16,10 +16,17 @@ #include <stdlib.h> #include <math.h> -#ifdef _MSC_VER -// I get these warnings from some flex versions: -// warning C4003: not enough actual parameters for macro 'yywrap' -# pragma warning( disable : 4003 ) +#if defined(_MSC_VER) && defined(ICE_64) +// +// '=' : conversion from 'size_t' to 'int', possible loss of data +// The result of fread() is a size_t and gets inserted into an int +// +# pragma warning( 4 : 4267 ) +// +// 'initializing' : conversion from '__int64' to 'int', possible loss of data +// Puts a pointer-difference into an int +// +# pragma warning( 4 : 4244 ) #endif using namespace std; diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 593282cf4b7..106063d4602 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1691,7 +1691,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) out << nl << "__is.startReadSlice();"; iter = 0; DataMemberList classMembers = p->classDataMembers(); - long classMemberCount = allClassMembers.size() - classMembers.size(); + size_t classMemberCount = allClassMembers.size() - classMembers.size(); for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -2002,7 +2002,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) out << nl << "__is.startReadSlice();"; iter = 0; DataMemberList classMembers = p->classDataMembers(); - long classMemberCount = allClassMembers.size() - classMembers.size(); + size_t classMemberCount = allClassMembers.size() - classMembers.size(); for(d = members.begin(); d != members.end(); ++d) { ostringstream patchParams; |