summaryrefslogtreecommitdiff
path: root/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'qpid')
-rw-r--r--qpid/cpp/src/qpid/sys/posix/Time.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/Time.cpp b/qpid/cpp/src/qpid/sys/posix/Time.cpp
index 10c730af73..b78a7e254a 100644
--- a/qpid/cpp/src/qpid/sys/posix/Time.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/Time.cpp
@@ -93,15 +93,15 @@ std::istream& operator>>(std::istream& i, Duration& d) {
if (i.fail()) return i;
if (i.eof() || std::isspace(i.peek())) // No suffix
- d = number*TIME_SEC;
+ d = int64_t(number*TIME_SEC);
else {
std::string suffix;
i >> suffix;
if (i.fail()) return i;
- if (suffix.compare("s") == 0) d = number*TIME_SEC;
- else if (suffix.compare("ms") == 0) d = number*TIME_MSEC;
- else if (suffix.compare("us") == 0) d = number*TIME_USEC;
- else if (suffix.compare("ns") == 0) d = number*TIME_NSEC;
+ if (suffix.compare("s") == 0) d = int64_t(number*TIME_SEC);
+ else if (suffix.compare("ms") == 0) d = int64_t(number*TIME_MSEC);
+ else if (suffix.compare("us") == 0) d = int64_t(number*TIME_USEC);
+ else if (suffix.compare("ns") == 0) d = int64_t(number*TIME_NSEC);
else i.setstate(std::ios::failbit);
}
return i;