8d40adad | 22-Aug-2024 |
Igor Kononenko <i.kononenko.e@gmail.com> |
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
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>
show more ...
|
66492215 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
bus: reduce forward declaration for friendship
Generally we do not want users to be able to get the underlying `sd_bus` pointer held by the `bus_t`, but there are a number of classes inside sdbusplu
bus: reduce forward declaration for friendship
Generally we do not want users to be able to get the underlying `sd_bus` pointer held by the `bus_t`, but there are a number of classes inside sdbusplus that do need the bus so that they can make appropriate sd_bus call. Previously, we've required every one of these classes to be forward declared inside `bus.hpp`, which is clutter. Create a new class, with a simple static function, which can be inherited by any internal class and allows access to the underlying `sd_bus*`.
Refactor classes which were previously friends to now inherit from this class.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ide0e7147801d01dc45b255261ba2cafefabddbb1
show more ...
|
a7ac313c | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
slot: explicitly transfer pointer
The slot class is intended to be an RAII wrapper around the C-style `sd_bus_slot*`. As part of the constructor it gets the pointer it is assuming ownership for.
T
slot: explicitly transfer pointer
The slot class is intended to be an RAII wrapper around the C-style `sd_bus_slot*`. As part of the constructor it gets the pointer it is assuming ownership for.
The previous constructor took the `sd_bus_slot*` by value so it was possible that the caller still kept the slot rather than fully transferring ownership. Switch the constructor to an r-value reference so that the caller's pointer can be erased as part of the ownership transfer.
Also, add an assignment operator to simplify the syntax when a slot is first initialized with `nullptr` and then later given ownership of a newly constructed slot.
While this is an incompatible constructor change, it is not expected to affect any current users. The only example of referencing a `slot::slot` I could see in the current OpenBMC org calls the constructor with a `nullptr`, which will seamlessly call the new r-value variant.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I577de2e10e4d5ccae6337c763b848ea4cf2121dd
show more ...
|