Skip to content

Commit

Permalink
fix(hook): use bit_cast to avoid warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed May 22, 2024
1 parent bfc545e commit 3df2b67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/lime/hooks/hook.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "hook.hpp"

#include <bit>

namespace lime
{
template <detail::function_signature Signature, convention Convention>
Expand All @@ -15,8 +17,8 @@ namespace lime
hook<Signature, Convention>::rtn_t<std::unique_ptr> hook<Signature, Convention>::create(Source source,
Target target)
{
auto source_address = *reinterpret_cast<std::uintptr_t *>(&source);
auto target_address = *reinterpret_cast<std::uintptr_t *>(&target);
auto source_address = std::bit_cast<std::uintptr_t>(source);
auto target_address = std::bit_cast<std::uintptr_t>(target);

auto rtn = hook_base::create(source_address, target_address);

Expand Down

0 comments on commit 3df2b67

Please sign in to comment.