From a19166ddec72cd58e4cbaaf6bfbd10c01cfcc171 Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Sat, 20 Jan 2024 19:51:18 -0300 Subject: [PATCH] pica_types: minor cleanup --- src/video_core/pica_types.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/video_core/pica_types.h b/src/video_core/pica_types.h index 4fd27f9fe..ad454555e 100644 --- a/src/video_core/pica_types.h +++ b/src/video_core/pica_types.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include @@ -50,7 +51,7 @@ public: hex = sign; } - std::memcpy(&res.value, &hex, sizeof(float)); + res.value = std::bit_cast(hex); return res; } @@ -95,17 +96,17 @@ public: } constexpr Float& operator/=(const Float& flt) { - value /= flt.ToFloat32(); + value = operator/(flt).value; return *this; } constexpr Float& operator+=(const Float& flt) { - value += flt.ToFloat32(); + value = operator+(flt).value; return *this; } constexpr Float& operator-=(const Float& flt) { - value -= flt.ToFloat32(); + value = operator-(flt).value; return *this; }