From 7e45cb2855032a492e32cb3b7f1e102cda0557b3 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 26 Sep 2026 12:10:17 +0000 Subject: [PATCH] 2026-09-26 12:10:17 Signed-off-by: lizzie --- src/core/hle/service/service.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 76870338c5..547284e32e 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -151,37 +151,40 @@ protected: /// @param expected_header_ request header in the command buffer which will trigger dispatch to this handler /// @param handler_callback_ member function in this service which will be called to handle the request /// @param name_ human-friendly name for the request. Used mostly for logging purposes. - constexpr FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_, u32 version_gating_ = 0) - : FunctionInfoBase{HandlerFnP(handler_callback_), name_, version_gating_} + explicit constexpr FunctionInfoTyped(u32 expected_header_, HandlerFnP handler_callback_, const char* name_, u32 version_gating_ = 0) + : handler_callback{handler_callback_} + , version_gating{version_gating_} , expected_header{expected_header_} {} + HandlerFnP handler_callback; + u32 version_gating; u32 expected_header; }; using FunctionInfo = FunctionInfoTyped; template //requires (std::same_as && ...) - [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMap(Ts... args) { - return frozen::map, sizeof...(args)>{ - {args.expected_header, HandlerFnP(args.handler_callback)}... + [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMap(Ts... args) { + return frozen::map, sizeof...(args)>{ + {args.expected_header, args.handler_callback}... }; } // Used exclusively by NFC template //requires (std::same_as> && ...) - [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMapWithClass(Ts... args) { - return frozen::map, sizeof...(args)>{ - {args.expected_header, HandlerFnP(args.handler_callback)}... + [[nodiscard]] static consteval frozen::map, sizeof...(Ts)> CreateStaticMapWithClass(Ts... args) { + return frozen::map, sizeof...(args)>{ + {args.expected_header, args.handler_callback}... }; } template - [[nodiscard]] static constexpr std::optional HandlerTableGenerateWithFind(u32 key, T const& map) { + [[nodiscard]] static std::optional HandlerTableGenerateWithFind(u32 key, T const& map) { auto const it = map.find(key); if (it != map.end()) { auto fake = FunctionInfoBase{}; - fake.handler_callback = it->second; + fake.handler_callback = HandlerFnP(it->second); return std::optional{fake}; } return std::nullopt;