sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5bc54a17954f74651bff4fbdd7f7dd7e7cfb084e
diff --git a/src/cmd.cpp b/src/cmd.cpp
index aa8bbae..a51bc22 100644
--- a/src/cmd.cpp
+++ b/src/cmd.cpp
@@ -21,11 +21,11 @@
namespace kcsbridge
{
-using sdbusplus::bus::bus;
-using sdbusplus::message::message;
-using sdbusplus::slot::slot;
+using sdbusplus::bus_t;
+using sdbusplus::message_t;
+using sdbusplus::slot_t;
-void write(stdplus::Fd& kcs, message&& m)
+void write(stdplus::Fd& kcs, message_t&& m)
{
std::array<uint8_t, 1024> buffer;
std::span<uint8_t> out(buffer.begin(), 3);
@@ -64,7 +64,7 @@
stdplus::fd::writeExact(kcs, out);
}
-void read(stdplus::Fd& kcs, bus& bus, slot& outstanding)
+void read(stdplus::Fd& kcs, bus_t& bus, slot_t& outstanding)
{
std::array<uint8_t, 1024> buffer;
auto in = stdplus::fd::read(kcs, buffer);
@@ -75,7 +75,7 @@
if (outstanding)
{
fmt::print(stderr, "Canceling outstanding request\n");
- outstanding = slot(nullptr);
+ outstanding = slot_t(nullptr);
}
if (in.size() < 2)
{
@@ -90,8 +90,8 @@
uint8_t netfn = in[0] >> 2, lun = in[0] & 3, cmd = in[1];
m.append(netfn, lun, cmd, in.subspan(2), options);
outstanding = m.call_async(
- stdplus::exception::ignore([&outstanding, &kcs](message&& m) {
- outstanding = slot(nullptr);
+ stdplus::exception::ignore([&outstanding, &kcs](message_t&& m) {
+ outstanding = slot_t(nullptr);
write(kcs, std::move(m));
}));
}