From 53abfac6acd04dff80ec6c8cfb0dd53f2f74dadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 18 Jul 2022 03:25:00 +0200 Subject: Improve Library::GetProcAddress. It isn't really more safe, but it removes the need for a confusing function pointer cast, which is easy to get wrong. As far as the compiler is concerned, the result is literally the same, but it does force the caller to (indirectly, via the template parameter) cast the return value, which may be a good thing. --- c/common.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'c/common.cpp') diff --git a/c/common.cpp b/c/common.cpp index c04d986..d503133 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -57,8 +57,3 @@ Library::~Library() { FreeLibrary(m_hModule); } - -void* Library::GetProcAddress(const char* const szProc) -{ - return (void*)::GetProcAddress(m_hModule, szProc); -} -- cgit v1.2.3