mirror of https://github.com/PCSX2/pcsx2.git
Debugger: Use bit_cast where needed, cleanup some stuff
This commit is contained in:
parent
c863876dee
commit
6bec3162f6
|
@ -334,22 +334,16 @@ void CtrlMemSearch::onSearchTypeChanged(wxCommandEvent& evt)
|
|||
case SEARCHTYPE::QWORD:
|
||||
radBigEndian->Enable(true);
|
||||
radLittleEndian->Enable(true);
|
||||
chkHexadecimal->Enable(false);
|
||||
chkHexadecimal->Enable(true);
|
||||
break;
|
||||
case SEARCHTYPE::FLOAT:
|
||||
case SEARCHTYPE::DOUBLE:
|
||||
case SEARCHTYPE::STRING:
|
||||
radBigEndian->Enable(false);
|
||||
radLittleEndian->Enable(false);
|
||||
chkHexadecimal->Enable(false);
|
||||
chkHexadecimal->SetValue(false);
|
||||
break;
|
||||
|
||||
case SEARCHTYPE::STRING:
|
||||
radBigEndian->Enable(true);
|
||||
radLittleEndian->Enable(true);
|
||||
chkHexadecimal->Enable(false);
|
||||
chkHexadecimal->SetValue(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "PrecompiledHeader.h"
|
||||
#include "CtrlRegisterList.h"
|
||||
#include "DebugTools/Debug.h"
|
||||
#include "Utilities/BitCast.h"
|
||||
|
||||
#include "DebugEvents.h"
|
||||
#include "gui/AppConfig.h"
|
||||
|
@ -288,8 +289,7 @@ void CtrlRegisterList::OnDraw(wxDC& dc)
|
|||
// and use this information for printing the VU0F titles
|
||||
for (int j = 3; j >= 0; j--)
|
||||
{
|
||||
// Use std::bit_cast in C++20. The below is technically UB
|
||||
sprintf(str, "%7.2f", *(float*)&val._u32[j]);
|
||||
sprintf(str, "%7.2f", bit_cast<float,u32>(val._u32[j]));
|
||||
dc.DrawText(wxString(str), x, y + 2);
|
||||
x += charWidth * 8 + 2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue