From 49542a5f648c74cc51a75c09be8e0917a8283e39 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 21 Dec 2023 09:19:52 +0100 Subject: [PATCH] Refactor Signed-off-by: Simon Rozman --- include/WinStd/COM.h | 6 ++---- include/WinStd/Common.h | 39 +++++++++++++-------------------------- include/WinStd/EAP.h | 9 +++------ include/WinStd/ETW.h | 9 +++------ include/WinStd/GDI.h | 3 +-- include/WinStd/Win.h | 15 +++++---------- 6 files changed, 27 insertions(+), 54 deletions(-) diff --git a/include/WinStd/COM.h b/include/WinStd/COM.h index 1a66b0f2..ff362fcf 100644 --- a/include/WinStd/COM.h +++ b/include/WinStd/COM.h @@ -32,8 +32,7 @@ namespace winstd /// \param[in] msg Error message /// com_runtime_error(_In_ error_type num, _In_ const std::string& msg) : num_runtime_error(num, msg) - { - } + {} /// /// Constructs an exception @@ -42,8 +41,7 @@ namespace winstd /// \param[in] msg Error message /// com_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) - { - } + {} }; /// @} diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index a647687b..b8408051 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -1033,8 +1033,7 @@ namespace winstd /// Initializes a new class instance with the object handle set to INVAL. /// handle() noexcept : m_h(invalid) - { - } + {} /// /// Initializes a new class instance with an already available object handle. @@ -1042,8 +1041,7 @@ namespace winstd /// \param[in] h Initial object handle value /// handle(_In_opt_ handle_type h) noexcept : m_h(h) - { - } + {} /// /// Move constructor @@ -1288,8 +1286,7 @@ namespace winstd /// Initializes a new class instance with the object handle set to INVAL. /// dplhandle() noexcept - { - } + {} /// /// Initializes a new class instance with an already available object handle. @@ -1297,8 +1294,7 @@ namespace winstd /// \param[in] h Initial object handle value /// dplhandle(_In_opt_ handle_type h) noexcept : handle(h) - { - } + {} /// /// Copy constructor @@ -1306,8 +1302,7 @@ namespace winstd /// \param[inout] h A reference of another object /// dplhandle(_In_ const dplhandle &h) : handle(duplicate_internal(h.m_h)) - { - } + {} /// /// Move constructor @@ -1315,8 +1310,7 @@ namespace winstd /// \param[inout] h A rvalue reference of another object /// dplhandle(_Inout_ dplhandle &&h) noexcept : handle(std::move(h)) - { - } + {} /// /// Attaches already available object handle. @@ -1494,8 +1488,7 @@ namespace winstd num_runtime_error(_In_ error_type num, _In_ const std::string& msg) : m_num(num), runtime_error(msg) - { - } + {} /// /// Constructs an exception @@ -1506,8 +1499,7 @@ namespace winstd num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : m_num(num), runtime_error(msg) - { - } + {} /// /// Returns the error number @@ -1858,8 +1850,7 @@ namespace winstd /// string_guid(_In_ const GUID &guid) : basic_string_guid, std::allocator >(guid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}") - { - } + {} /// @} }; @@ -1880,8 +1871,7 @@ namespace winstd /// wstring_guid(_In_ const GUID &guid) : basic_string_guid, std::allocator >(guid, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}") - { - } + {} /// @} }; @@ -1930,23 +1920,20 @@ namespace winstd /// Construct default allocator /// sanitizing_allocator() noexcept : _Mybase() - { - } + {} /// /// Construct by copying /// sanitizing_allocator(_In_ const sanitizing_allocator<_Ty> &_Othr) : _Mybase(_Othr) - { - } + {} /// /// Construct from a related allocator /// template sanitizing_allocator(_In_ const sanitizing_allocator<_Other> &_Othr) noexcept : _Mybase(_Othr) - { - } + {} /// /// Deallocate object at _Ptr sanitizing its content first diff --git a/include/WinStd/EAP.h b/include/WinStd/EAP.h index 42bf7ac5..5d04406d 100644 --- a/include/WinStd/EAP.h +++ b/include/WinStd/EAP.h @@ -590,8 +590,7 @@ namespace winstd m_repair_desc (err.pRepairString ), m_help_link_id (err.helpLinkGuid ), win_runtime_error(err.dwWinError, msg.c_str()) - { - } + {} /// /// Constructs an exception @@ -607,8 +606,7 @@ namespace winstd m_repair_desc (err.pRepairString ), m_help_link_id (err.helpLinkGuid ), win_runtime_error(err.dwWinError ) - { - } + {} /// /// Constructs an exception @@ -625,8 +623,7 @@ namespace winstd m_repair_desc (err.pRepairString ), m_help_link_id (err.helpLinkGuid ), win_runtime_error(err.dwWinError, msg ) - { - } + {} /// /// Returns EAP method type diff --git a/include/WinStd/ETW.h b/include/WinStd/ETW.h index 1b43c242..254b5fa0 100644 --- a/include/WinStd/ETW.h +++ b/include/WinStd/ETW.h @@ -727,8 +727,7 @@ namespace winstd /// Initializes a new empty session. /// event_session() - { - } + {} /// /// Initializes a new session with an already available object handle. @@ -751,8 +750,7 @@ namespace winstd event_session(_Inout_ event_session &&other) noexcept : m_prop(std::move(other.m_prop)), handle(std::move(other)) - { - } + {} /// /// Closes the session. @@ -1073,8 +1071,7 @@ namespace winstd m_ep(other.m_ep), m_event_dest(other.m_event_dest), m_fn_name(other.m_fn_name) - { - } + {} /// /// Moves the object diff --git a/include/WinStd/GDI.h b/include/WinStd/GDI.h index e59f88cd..2c9b43f3 100644 --- a/include/WinStd/GDI.h +++ b/include/WinStd/GDI.h @@ -193,8 +193,7 @@ namespace winstd dc_selector(_In_ HDC hdc, _In_ HGDIOBJ h) noexcept : m_hdc(hdc), m_orig(SelectObject(hdc, h)) - { - } + {} /// /// Restores original object. diff --git a/include/WinStd/Win.h b/include/WinStd/Win.h index c19a42e9..744ce99f 100644 --- a/include/WinStd/Win.h +++ b/include/WinStd/Win.h @@ -1343,8 +1343,7 @@ namespace winstd /// \param[in] heap Handle to existing heap /// heap_allocator(_In_ HANDLE heap) : m_heap(heap) - { - } + {} /// /// Constructs allocator from another type @@ -1353,8 +1352,7 @@ namespace winstd /// template heap_allocator(_In_ const heap_allocator<_Other> &other) : m_heap(other.m_heap) - { - } + {} /// /// Allocates a new memory block @@ -1651,8 +1649,7 @@ namespace winstd /// Initializes a new class instance with the memory handle set to INVAL. /// vmemory() noexcept : m_proc(NULL) - { - } + {} /// /// Initializes a new class instance with an already available object handle. @@ -1663,8 +1660,7 @@ namespace winstd vmemory(_In_ handle_type h, _In_ HANDLE proc) noexcept : m_proc(proc), handle(h) - { - } + {} /// /// Move constructor @@ -1674,8 +1670,7 @@ namespace winstd vmemory(_Inout_ vmemory &&h) noexcept : m_proc(std::move(h.m_proc)), handle(std::move(h)) - { - } + {} /// /// Frees the memory.