From 79ef6855eb38edd03b51d2f5a2f614cdd7b9fcf1 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 3 Sep 2026 13:38:00 +0200 Subject: chore: add missing [[nodiscard]] attributes --- kapi/kapi/devices/facet_registry.hpp | 9 +++++---- kapi/kapi/devices/power.hpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'kapi') diff --git a/kapi/kapi/devices/facet_registry.hpp b/kapi/kapi/devices/facet_registry.hpp index 7006c026..3c405923 100644 --- a/kapi/kapi/devices/facet_registry.hpp +++ b/kapi/kapi/devices/facet_registry.hpp @@ -150,7 +150,7 @@ namespace kapi::devices //! @param device The device to publish the facet for. //! @param name A stable name for the device. template - auto publish(kstd::shared_ptr device, kstd::string name) -> kstd::result + [[nodiscard]] auto publish(kstd::shared_ptr device, kstd::string name) -> kstd::result { if (!device) { @@ -172,7 +172,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param facet The implementation of the facet for the device. template - auto publish(kstd::shared_ptr device, kstd::string name, FacetType * facet) -> kstd::result + [[nodiscard]] auto publish(kstd::shared_ptr device, kstd::string name, FacetType * facet) + -> kstd::result { return do_publish(device, std::move(name), FacetType::id, facet); } @@ -254,8 +255,8 @@ namespace kapi::devices //! @param name A stable name for the device. //! @param id The id of the facet to be published for the device. //! @param facet The facet of the device. - auto do_publish(kstd::shared_ptr device, kstd::string name, kapi::capabilities::facet_id id, void * facet) - -> kstd::result; + [[nodiscard]] auto do_publish(kstd::shared_ptr device, kstd::string name, kapi::capabilities::facet_id id, + void * facet) -> kstd::result; //! Notify all subscribed observers about a new facet having been published for a device. //! diff --git a/kapi/kapi/devices/power.hpp b/kapi/kapi/devices/power.hpp index 44837a65..a87ebc78 100644 --- a/kapi/kapi/devices/power.hpp +++ b/kapi/kapi/devices/power.hpp @@ -21,7 +21,7 @@ namespace kapi::devices //! //! @param root The root of the tree to suspend. //! @return nothing on success, the first error to occur otherwise. - auto suspend_tree(bus & root) -> kstd::result; + [[nodiscard]] auto suspend_tree(bus & root) -> kstd::result; //! Resume a device (sub-)tree rooted in a given bus. //! -- cgit v1.2.3 From e9c8e851eedeabe82878ef9d41042731c4d17e6d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 3 Sep 2026 14:07:25 +0200 Subject: chore: add missing explicit specifiers --- kapi/kapi/devices/bus.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kapi') diff --git a/kapi/kapi/devices/bus.hpp b/kapi/kapi/devices/bus.hpp index dc46dc3a..aaca462a 100644 --- a/kapi/kapi/devices/bus.hpp +++ b/kapi/kapi/devices/bus.hpp @@ -28,7 +28,7 @@ namespace kapi::devices //! Construct a bus with the given name. //! //! @param name The name of the bus. - bus(kstd::string const & name); + explicit bus(kstd::string const & name); //! Construct a bus with the given name and protocol. //! -- cgit v1.2.3 From 28114ae949130d39380a80800c60b5b334d61b19 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 3 Sep 2026 14:14:17 +0200 Subject: chore: fix header guards --- kapi/kapi/filesystem.hpp | 2 +- kapi/kapi/memory/frame_allocator.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'kapi') diff --git a/kapi/kapi/filesystem.hpp b/kapi/kapi/filesystem.hpp index 04630006..ab8a8f4a 100644 --- a/kapi/kapi/filesystem.hpp +++ b/kapi/kapi/filesystem.hpp @@ -119,4 +119,4 @@ namespace kapi::filesystem //! @} } // namespace kapi::filesystem -#endif // TEACHOS_KAPI_FILESYSTEM_HPP \ No newline at end of file +#endif \ No newline at end of file diff --git a/kapi/kapi/memory/frame_allocator.hpp b/kapi/kapi/memory/frame_allocator.hpp index 783bd3cb..12f56c2d 100644 --- a/kapi/kapi/memory/frame_allocator.hpp +++ b/kapi/kapi/memory/frame_allocator.hpp @@ -68,4 +68,4 @@ namespace kapi::memory } // namespace kapi::memory -#endif // TEACHOS_KAPI_MEMORY_FRAME_ALLOCATOR_HPP \ No newline at end of file +#endif \ No newline at end of file -- cgit v1.2.3