summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-02-28 19:56:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-02-28 19:56:59 +0100
commitb1c1a1a78186aa2d90378ebf15d779077c4a182f (patch)
tree71886dc4135ef23c72365669e697c2326ef446e3
parented2e166f95c1a8b7fde97383520dbd5866b14dab (diff)
api: kill useless cast
-rw-r--r--api/plugin-support.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/plugin-support.hpp b/api/plugin-support.hpp
index 1ee8e093..df1344bf 100644
--- a/api/plugin-support.hpp
+++ b/api/plugin-support.hpp
@@ -232,8 +232,8 @@ private:
template<typename t>
std::shared_ptr<t> make_dylib_instance(const std::shared_ptr<dylib>& lib)
{
- std::shared_ptr<t> ret;
if (lib != nullptr && lib->Constructor)
- ret = std::shared_ptr<t>(reinterpret_cast<t*>(reinterpret_cast<module_ctor_t>(lib->Constructor)()));
- return ret;
+ return std::shared_ptr<t>{(t*)lib->Constructor()};
+ else
+ return nullptr;
}