From d13bcd994e89bb4c2e53ff1c5b05f3645511a7dd Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 23 Apr 2013 19:55:50 +0000 Subject: 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 --- qpid/cpp/src/qpid/sys/posix/Time.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'qpid/cpp/src') 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; -- cgit v1.2.1