summaryrefslogtreecommitdiff
path: root/Userland/DevTools/UserspaceEmulator
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-04-07 20:23:38 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-08 23:57:16 +0200
commit58e373c0f294d06f6a5fe7417b3a2a134b2cc940 (patch)
tree3b5c593a1775087bf090d5a326d63e85d1a9395d /Userland/DevTools/UserspaceEmulator
parentc0c4e99c74b56aa38e585e994364a107dabfb306 (diff)
downloadserenity-58e373c0f294d06f6a5fe7417b3a2a134b2cc940.zip
UE: Use AK's bit_cast and not reimplement it
Diffstat (limited to 'Userland/DevTools/UserspaceEmulator')
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
index bf73af564b..97519ea500 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -27,6 +27,7 @@
#include "SoftCPU.h"
#include "Emulator.h"
#include <AK/Assertions.h>
+#include <AK/BitCast.h>
#include <AK/Debug.h>
#include <math.h>
#include <stdio.h>
@@ -57,15 +58,6 @@
namespace UserspaceEmulator {
-template<class Dest, class Source>
-static inline Dest bit_cast(Source source)
-{
- static_assert(sizeof(Dest) == sizeof(Source));
- Dest dest;
- memcpy(&dest, &source, sizeof(dest));
- return dest;
-}
-
template<typename T>
ALWAYS_INLINE void warn_if_uninitialized(T value_with_shadow, const char* message)
{