From 7691269b7b9ddf6fbed53048b9a5ae85d58fd4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 19 Jul 2022 19:54:46 +0200 Subject: Formatting. --- c/common.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'c/common.h') diff --git a/c/common.h b/c/common.h index acb8f26..efaa800 100644 --- a/c/common.h +++ b/c/common.h @@ -29,12 +29,12 @@ struct Library { Library(const TCHAR* tszLibrary); ~Library(); - template T* GetProcAddress(const char* szProc); + template T* GetProcAddress(const char* szProc); private: HMODULE m_hModule; }; -template +template T* Library::GetProcAddress(const char* const szProc) { return (T*)(void*)::GetProcAddress(m_hModule, szProc); @@ -43,8 +43,8 @@ T* Library::GetProcAddress(const char* const szProc) /* Create and return an object of type C. If construction fails, * return nothing. The returned value must be checked before being * used, as dereferencing is undefined if the value is empty. */ -template -std::optional maybe_make(T ...args) +template +std::optional maybe_make(T... args) { try { return C(args...); @@ -53,18 +53,18 @@ std::optional maybe_make(T ...args) } } -/* Call Windows API function and throw error if NULL is returned. */ -template -inline auto throw_nil(T ...args) +/* Call Windows API function, throwing error on NULL. */ +template +inline auto throw_nil(T... args) { auto r = f(args...); if (!r) throw Win32Error(GetLastError()); return r; } -/* Call Windows API function and show a warning if NULL is returned. */ -template -inline auto warn_nil(T ...args) +/* Call Windows API function, showing a warning on NULL. */ +template +inline auto warn_nil(T... args) { decltype(f(args...)) r; try { -- cgit v1.2.3