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: Ia40a8258d162ca5fbb07d91a652f5521f2465cda
diff --git a/hiomap.cpp b/hiomap.cpp
index 9253243..37debaa 100644
--- a/hiomap.cpp
+++ b/hiomap.cpp
@@ -254,10 +254,10 @@
struct hiomap
{
- bus::bus* bus;
+ bus_t* bus;
/* Signals */
- bus::match::match* properties;
+ bus::match_t* properties;
/* Protocol state */
std::map<std::string, int> event_lookup;
@@ -336,7 +336,7 @@
}
static int hiomap_handle_property_update(struct hiomap* ctx,
- sdbusplus::message::message& msg)
+ sdbusplus::message_t& msg)
{
using namespace phosphor::logging;
@@ -419,12 +419,12 @@
return 0;
}
-static bus::match::match hiomap_match_properties(struct hiomap* ctx)
+static bus::match_t hiomap_match_properties(struct hiomap* ctx)
{
auto properties =
bus::match::rules::propertiesChanged(HIOMAPD_OBJECT, HIOMAPD_IFACE_V2);
- bus::match::match match(
+ bus::match_t match(
*ctx->bus, properties,
std::bind(hiomap_handle_property_update, ctx, std::placeholders::_1));
@@ -445,7 +445,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -488,7 +488,7 @@
*data_len = 4;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -518,7 +518,7 @@
*data_len = 4;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -560,7 +560,7 @@
*data_len = 6;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -611,7 +611,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -644,7 +644,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -668,7 +668,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -699,7 +699,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -731,7 +731,7 @@
*data_len = 0;
}
- catch (const exception::exception& e)
+ catch (const exception_t& e)
{
return hiomap_xlate_errno(e.get_errno());
}
@@ -845,7 +845,7 @@
ctx->event_lookup["WindowReset"] = BMC_EVENT_WINDOW_RESET;
ctx->event_lookup["ProtocolReset"] = BMC_EVENT_PROTOCOL_RESET;
- ctx->bus = new bus::bus(ipmid_get_sd_bus_connection());
+ ctx->bus = new bus_t(ipmid_get_sd_bus_connection());
/* Initialise signal handling */
@@ -853,8 +853,7 @@
* Can't use temporaries here because that causes SEGFAULTs due to slot
* destruction (!?), so enjoy the weird wrapping.
*/
- ctx->properties =
- new bus::match::match(std::move(hiomap_match_properties(ctx)));
+ ctx->properties = new bus::match_t(std::move(hiomap_match_properties(ctx)));
std::function<SignalResponse(int)> shutdownHandler =
[ctx]([[maybe_unused]] int signalNumber) {