summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-04-23 19:55:50 +0000
committerAlan Conway <aconway@apache.org>2013-04-23 19:55:50 +0000
commitd13bcd994e89bb4c2e53ff1c5b05f3645511a7dd (patch)
tree07163b51c694b5f4b9d2b9c4c5a0eb89a66444cd
parent7e4afefa9aa19353d84551a8783c50111ddd92a6 (diff)
downloadqpid-python-d13bcd994e89bb4c2e53ff1c5b05f3645511a7dd.tar.gz
NO-JIRA: Fix compilation warnings introduced by r1469661.
Added explicit conversion from double to int16_t. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1471121 13f79535-47bb-0310-9956-ffa450edef68
-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;