transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project
contains compile warning which can be interpreted as compile error (if
external project defines both `-Werror` and `-Wconversion`)
Changing the `Transaction::time` property type to the appropriate
`std::time_t` will solve the issue.
Change-Id: I9ab42472ff361aab9487c73d7804531151986e4c
Signed-off-by: Igor Kononenko <i.kononenko.e@gmail.com>
diff --git a/include/sdbusplus/server/transaction.hpp b/include/sdbusplus/server/transaction.hpp
index 50c9677..af56b33 100644
--- a/include/sdbusplus/server/transaction.hpp
+++ b/include/sdbusplus/server/transaction.hpp
@@ -25,7 +25,7 @@
Transaction() : time(std::time(nullptr)), thread(std::this_thread::get_id())
{}
- int time;
+ std::time_t time;
std::thread::id thread;
};
diff --git a/src/server/transaction.cpp b/src/server/transaction.cpp
index bfd902a..671116d 100644
--- a/src/server/transaction.cpp
+++ b/src/server/transaction.cpp
@@ -88,7 +88,7 @@
size_t hash<sdbusplus::server::transaction::details::Transaction>::operator()(
const sdbusplus::server::transaction::details::Transaction& t) const
{
- auto hash1 = std::hash<int>{}(t.time);
+ auto hash1 = std::hash<std::time_t>{}(t.time);
auto hash2 = std::hash<std::thread::id>{}(t.thread);
// boost::hash_combine() algorithm.