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 | |
parent | Fixed dependencies (diff) | |
download | ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.tar.bz2 ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.tar.xz ice-deda1e21772f8efcaf91baab3a9e896c471b0f32.zip |
Windows x64 port
Diffstat (limited to 'cpp')
30 files changed, 148 insertions, 87 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES index c08fd0fde08..4d125663372 100644 --- a/cpp/CHANGES +++ b/cpp/CHANGES @@ -1,3 +1,9 @@ +Changes since version 3.0.0 +--------------------------- + +- Windows x64 port; INSTALL.WINDOWS now shows how to target the + x64 platform. + Changes since version 2.1.2 --------------------------- diff --git a/cpp/INSTALL.WINDOWS b/cpp/INSTALL.WINDOWS index 5f5c3396e41..3963f751786 100644 --- a/cpp/INSTALL.WINDOWS +++ b/cpp/INSTALL.WINDOWS @@ -26,7 +26,7 @@ The following Microsoft Visual C++ compilers are supported: - Visual C++ .NET 2003 (aka VC++ 7.1) -- Visual C++ .NET 2005 (aka VC++ 8) +- Visual C++ .NET 2005 (aka VC++ 8.0) The STL (Standard Template Library) that is included with Visual C++ 6.0 is not supported. You must use STLport 4.5 (or later) with Visual @@ -49,8 +49,8 @@ Ice has dependencies on a number of third-party libraries: Except for Visual C++ 2005, if you have downloaded an Ice binary installer, you already have all of the required third-party libraries and do not need to download any additional packages, nor do you need to compile the Ice source -code. (For Visual C++ 2005, you will need to compile and install the third-party -libraries from source.) +code. (For Visual C++ .NET 2005, you will need to compile and install the +third-party libraries from source.) You can download an installer containing binaries for all of the required third-party libraries (except for Visual C++ 2005) from the ZeroC web site at @@ -182,6 +182,26 @@ If you want to try out any of the demos, make sure to update your PATH environment variable to add the "bin" directory, which contains the Ice DLLs and executables. +====================================================================== +x64 Platform +====================================================================== +You can target the x64 platform when building Ice with Visual C++ +.NET 2005. Follow these steps when converting the Ice Visual C++ 6.0 +projects into Visual Studio .NET 2005 projects: + - Let Visual Studio .NET 2005 convert automatically all your project + files. + - In Build/Configuration Manager/Active solution plaform, create + a new solution platform named x64 (from the drop-down list). + Keep the default selections (Copy settings from Win32 and + Create new project platforms) + - Then in the Solution Explorer window, select all projects. + - Select the Project/Properties menu + - In Configuration Properties/General, change "Ouput Directory" + to be just $(ConfigurationName) and "Intermediate Directory" + to be just $(ConfigurationName) + - You need to perform the previous step for both "Debug" and + "Release" configurations (or All configurations). + - Finally, save all your project files. ====================================================================== Windows 98, Windows 98 SE, Windows ME, Windows NT 3.51 diff --git a/cpp/demo/Freeze/library/Scanner.l b/cpp/demo/Freeze/library/Scanner.l index 31484dfaf93..ea8f8e07299 100644 --- a/cpp/demo/Freeze/library/Scanner.l +++ b/cpp/demo/Freeze/library/Scanner.l @@ -12,10 +12,12 @@ #include <Parser.h> #include <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/demo/Freeze/phonebook/Scanner.l b/cpp/demo/Freeze/phonebook/Scanner.l index 6ee2e17a287..71148cc151e 100644 --- a/cpp/demo/Freeze/phonebook/Scanner.l +++ b/cpp/demo/Freeze/phonebook/Scanner.l @@ -12,10 +12,12 @@ #include <Parser.h> #include <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/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 7ebccac2cd6..5d4dd8783fd 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -171,10 +171,13 @@ private: // // Int64 typedef // -#if defined(ICE_64) -typedef long Int64; -#elif defined(_MSC_VER) +#if defined(_MSC_VER) +// +// On Windows, long is always 32-bit +// typedef __int64 Int64; +#elif defined(ICE_64) +typedef long Int64; #else typedef long long Int64; #endif @@ -184,10 +187,10 @@ typedef long long Int64; // // ICE_INT64: macro for Int64 literal values // -#if defined(ICE_64) -# define ICE_INT64(n) n##L -#elif defined(_MSC_VER) +#if defined(_MSC_VER) # define ICE_INT64(n) n##i64 +#elif defined(ICE_64) +# define ICE_INT64(n) n##L #else # define ICE_INT64(n) n##LL #endif diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/include/IceUtil/DisableWarnings.h index ee8ecffebdb..f10125ac5a9 100644 --- a/cpp/include/IceUtil/DisableWarnings.h +++ b/cpp/include/IceUtil/DisableWarnings.h @@ -14,18 +14,15 @@ // This header file disables various annoying compiler warnings that // we don't want. // -// IMPORTANT: Do *not* include this header file in another header file! +// IMPORTANT: Do *not* include this header file in another public header file! // Doing this may potentially disable the warnings in the source // code of our customers, which would be bad. Only include this // header file in Ice *source* files! // -#if _WIN32 && _MSC_VER >= 1400 - +#if defined(_MSC_VER) && _MSC_VER >= 1400 # define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated/ - -# pragma warning(disable: 4996) // C4996 'std::<function>' was declared deprecated - +# pragma warning( 4 : 4996 ) // C4996 'std::<function>' was declared deprecated #endif #endif 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; diff --git a/cpp/test/Freeze/complex/Scanner.l b/cpp/test/Freeze/complex/Scanner.l index f125526c281..f09bfc372cd 100644 --- a/cpp/test/Freeze/complex/Scanner.l +++ b/cpp/test/Freeze/complex/Scanner.l @@ -14,10 +14,12 @@ #include <Grammar.h> #include <NodeI.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/test/IceUtil/inputUtil/Client.cpp b/cpp/test/IceUtil/inputUtil/Client.cpp index 12c337ec47f..82afd1d54f9 100644 --- a/cpp/test/IceUtil/inputUtil/Client.cpp +++ b/cpp/test/IceUtil/inputUtil/Client.cpp @@ -19,14 +19,12 @@ using namespace std; #if defined(_MSC_VER) const Int64 Int64Min = -9223372036854775808i64; const Int64 Int64Max = 9223372036854775807i64; -#else -# if defined(ICE_64) +#elif defined(ICE_64) const Int64 Int64Min = -0x7fffffffffffffffL-1L; const Int64 Int64Max = 0x7fffffffffffffffL; -# else +#else const Int64 Int64Min = -0x7fffffffffffffffLL-1LL; const Int64 Int64Max = 0x7fffffffffffffffLL; -# endif #endif int |