Bläddra i källkod

UE: Use AK's bit_cast and not reimplement it

Hendiadyoin1 4 år sedan
förälder
incheckning
58e373c0f2
1 ändrade filer med 1 tillägg och 9 borttagningar
  1. 1 9
      Userland/DevTools/UserspaceEmulator/SoftCPU.cpp

+ 1 - 9
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)
 {