Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'util/usage.cc')
-rw-r--r--util/usage.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/usage.cc b/util/usage.cc
index 8db375e14..25fc09755 100644
--- a/util/usage.cc
+++ b/util/usage.cc
@@ -83,7 +83,7 @@ void PrintUsage(std::ostream &out) {
}
struct rusage usage;
- if (getrusage(RUSAGE_CHILDREN, &usage)) {
+ if (getrusage(RUSAGE_SELF, &usage)) {
perror("getrusage");
return;
}
@@ -135,7 +135,7 @@ template <class Num> uint64_t ParseNum(const std::string &arg) {
if (after == "%") {
uint64_t mem = GuessPhysicalMemory();
UTIL_THROW_IF_ARG(!mem, SizeParseError, (arg), "because % was specified but the physical memory size could not be determined.");
- return static_cast<double>(value) * static_cast<double>(mem) / 100.0;
+ return static_cast<uint64_t>(static_cast<double>(value) * static_cast<double>(mem) / 100.0);
}
std::string units("bKMGTPEZY");
@@ -144,7 +144,7 @@ template <class Num> uint64_t ParseNum(const std::string &arg) {
for (std::string::size_type i = 0; i < index; ++i) {
value *= 1024;
}
- return value;
+ return static_cast<uint64_t>(value);
}
} // namespace