summaryrefslogtreecommitdiff
path: root/cpp
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
commit5e766541328153118de91ced8cd473fd4d74fe91 (patch)
treed5b14529e7a36eec851c04fce08b52a32103bedf /cpp
parentcd66c338c5708d85ad2cdf25f0624a7a7eda382e (diff)
downloadqpid-python-5e766541328153118de91ced8cd473fd4d74fe91.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/qpid@1471121 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/sys/posix/Time.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/posix/Time.cpp b/cpp/src/qpid/sys/posix/Time.cpp
index 10c730af73..b78a7e254a 100644
--- a/cpp/src/qpid/sys/posix/Time.cpp
+++ b/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;