[kyua-cli] Fix conversions to microseconds under i686
Julio Merino
jmmv at fedoraproject.org
Tue Jun 19 01:16:26 UTC 2012
commit 1f370dd218da31701d5f28c90450367e55ad8c3f
Author: Julio Merino <jmmv at julipedia.org>
Date: Mon Jun 18 21:05:47 2012 -0400
Fix conversions to microseconds under i686
Apply a patch to fix the conversion of timestamps to microseconds under
i686 by ensuring that the result values are int64_t. This fixes the
build of kyua-cli-0.4-2.
kyua-cli-0.4-fix-microseconds-i686.diff | 21 +++++++++++++++++++++
kyua-cli.spec | 2 ++
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/kyua-cli-0.4-fix-microseconds-i686.diff b/kyua-cli-0.4-fix-microseconds-i686.diff
new file mode 100644
index 0000000..1ceb0ef
--- /dev/null
+++ b/kyua-cli-0.4-fix-microseconds-i686.diff
@@ -0,0 +1,21 @@
+--- utils/datetime.cpp
++++ utils/datetime.cpp
+@@ -295,7 +295,8 @@ datetime::timestamp::strftime(const std::string& format) const
+ int64_t
+ datetime::timestamp::to_microseconds(void) const
+ {
+- return _pimpl->data.tv_sec * 1000000 + _pimpl->data.tv_usec;
++ return static_cast< int64_t >(_pimpl->data.tv_sec) * 1000000 +
++ _pimpl->data.tv_usec;
+ }
+
+
+@@ -305,7 +306,7 @@ datetime::timestamp::to_microseconds(void) const
+ int64_t
+ datetime::timestamp::to_seconds(void) const
+ {
+- return _pimpl->data.tv_sec;
++ return static_cast< int64_t >(_pimpl->data.tv_sec);
+ }
+
+
diff --git a/kyua-cli.spec b/kyua-cli.spec
index f9f6ead..6eed840 100644
--- a/kyua-cli.spec
+++ b/kyua-cli.spec
@@ -7,6 +7,7 @@ Group: Development/Tools
URL: http://code.google.com/p/kyua/
Source0: http://kyua.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: README.Fedora
+Patch0: %{name}-%{version}-fix-microseconds-i686.diff
Requires: lutok >= 0.2
Requires: sqlite >= 3.6.22
Requires(post): info
@@ -32,6 +33,7 @@ their results.
%prep
%setup -q
+%patch0
# Put the README.Fedora file in the top-level directory of the source tree so
# that the %doc call below can pick it up.
More information about the scm-commits
mailing list