diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IcePatch/Client.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IcePatch/Server.cpp | 43 | ||||
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 6 |
3 files changed, 44 insertions, 10 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp index 1393fde763a..53d456bc6a4 100644 --- a/cpp/src/IcePatch/Client.cpp +++ b/cpp/src/IcePatch/Client.cpp @@ -398,13 +398,12 @@ public: finishedDownload(total); if(_patchTotal > 0) { - Long l = _runningTotal + _fileTotal; - Ice::Int percent = (l * 100) / _patchTotal; + Long percent = ((_runningTotal + _fileTotal) * 100) / _patchTotal; if(percent > 100) { percent = 100; } - cout << " (" << percent << "% complete)"; + cout << " (" << static_cast<Int>(percent) << "% complete)"; } cout << endl; } diff --git a/cpp/src/IcePatch/Server.cpp b/cpp/src/IcePatch/Server.cpp index bfee1efefda..a81636eceeb 100644 --- a/cpp/src/IcePatch/Server.cpp +++ b/cpp/src/IcePatch/Server.cpp @@ -17,6 +17,9 @@ #include <IcePatch/FileLocator.h> #include <IcePatch/IcePatchI.h> #include <IcePatch/Util.h> +#ifdef _WIN32 +# include <direct.h> +#endif using namespace std; using namespace Ice; @@ -75,12 +78,44 @@ IcePatch::IcePatchService::IcePatchService() : void IcePatch::IcePatchService::usage(const string& name) { - cerr << "Usage: " << name << " [options]\n"; - cerr << + string options = "Options:\n" "-h, --help Show this message.\n" - "-v, --version Display the Ice version.\n" - ; + "-v, --version Display the Ice version."; +#ifdef _WIN32 + if(!win9x()) + { + options.append( + "\n" + "\n" + "--service NAME Run as the Windows service NAME.\n" + "\n" + "--install NAME [--display DISP] [--executable EXEC] [args]\n" + " Install as Windows service NAME. If DISP is\n" + " provided, use it as the display name,\n" + " otherwise NAME is used. If EXEC is provided,\n" + " use it as the service executable, otherwise\n" + " this executable is used. Any additional\n" + " arguments are passed unchanged to the\n" + " service at startup.\n" + "--uninstall NAME Uninstall Windows service NAME.\n" + "--start NAME [args] Start Windows service NAME. Any additional\n" + " arguments are passed unchanged to the\n" + " service.\n" + "--stop NAME Stop Windows service NAME." + ); + } +#else + options.append( + "\n" + "\n" + "--daemon Run as a daemon.\n" + "--noclose Do not close open file descriptors.\n" + "--nochdir Do not change the current working directory." + ); +#endif + cerr << "Usage: " << name << " [options]" << endl; + cerr << options << endl; } bool diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 3efc452a0cc..a867e9ad8aa 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -934,7 +934,7 @@ IcePatch::getTotalMap(const CommunicatorPtr& communicator, const string& path) } void -IcePatch::putTotalMap(const CommunicatorPtr& communicator, const string& path, const TotalMap& map) +IcePatch::putTotalMap(const CommunicatorPtr& communicator, const string& path, const TotalMap& tot) { IceInternal::InstancePtr instance = IceInternal::getInstance(communicator); IceInternal::BasicStream os(instance.get()); @@ -942,8 +942,8 @@ IcePatch::putTotalMap(const CommunicatorPtr& communicator, const string& path, c // // Marshal the map. // - os.writeSize(static_cast<Int>(map.size())); - for(TotalMap::const_iterator p = map.begin(); p != map.end(); ++p) + os.writeSize(static_cast<Int>(tot.size())); + for(TotalMap::const_iterator p = tot.begin(); p != tot.end(); ++p) { os.write(p->first); os.write(p->second); |