Fix a few warnings over the place

This commit is contained in:
Connor McLaughlin 2021-09-12 09:56:14 +10:00
parent 1cc6ee4857
commit c0a29f7bfd
3 changed files with 13 additions and 15 deletions

View File

@ -27,13 +27,13 @@ static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE s_d3d12_serialize_root_signature;
static bool LoadD3D12Library()
{
if (!(s_d3d12_library = LoadLibrary("d3d12.dll")) ||
!(s_d3d12_create_device =
reinterpret_cast<PFN_D3D12_CREATE_DEVICE>(GetProcAddress(s_d3d12_library, "D3D12CreateDevice"))) ||
!(s_d3d12_get_debug_interface =
reinterpret_cast<PFN_D3D12_GET_DEBUG_INTERFACE>(GetProcAddress(s_d3d12_library, "D3D12GetDebugInterface"))) ||
!(s_d3d12_serialize_root_signature = reinterpret_cast<PFN_D3D12_SERIALIZE_ROOT_SIGNATURE>(
GetProcAddress(s_d3d12_library, "D3D12SerializeRootSignature"))))
if ((s_d3d12_library = LoadLibrary("d3d12.dll")) == nullptr ||
(s_d3d12_create_device =
reinterpret_cast<PFN_D3D12_CREATE_DEVICE>(GetProcAddress(s_d3d12_library, "D3D12CreateDevice"))) == nullptr ||
(s_d3d12_get_debug_interface = reinterpret_cast<PFN_D3D12_GET_DEBUG_INTERFACE>(
GetProcAddress(s_d3d12_library, "D3D12GetDebugInterface"))) == nullptr ||
(s_d3d12_serialize_root_signature = reinterpret_cast<PFN_D3D12_SERIALIZE_ROOT_SIGNATURE>(
GetProcAddress(s_d3d12_library, "D3D12SerializeRootSignature"))) == nullptr)
{
Log_ErrorPrintf("d3d12.dll could not be loaded.");
s_d3d12_create_device = nullptr;

View File

@ -20,7 +20,6 @@ constexpr HostReg RARG2 = Xbyak::Operand::RDX;
constexpr HostReg RARG3 = Xbyak::Operand::R8;
constexpr HostReg RARG4 = Xbyak::Operand::R9;
constexpr u32 FUNCTION_CALL_SHADOW_SPACE = 32;
constexpr u64 FUNCTION_CALL_STACK_ALIGNMENT = 16;
#elif defined(ABI_SYSV)
constexpr HostReg RCPUPTR = Xbyak::Operand::RBP;
constexpr HostReg RMEMBASEPTR = Xbyak::Operand::RBX;
@ -30,7 +29,6 @@ constexpr HostReg RARG2 = Xbyak::Operand::RSI;
constexpr HostReg RARG3 = Xbyak::Operand::RDX;
constexpr HostReg RARG4 = Xbyak::Operand::RCX;
constexpr u32 FUNCTION_CALL_SHADOW_SPACE = 0;
constexpr u64 FUNCTION_CALL_STACK_ALIGNMENT = 16;
#endif
static const Xbyak::Reg8 GetHostReg8(HostReg reg)
@ -798,20 +796,20 @@ void CodeGenerator::EmitDiv(HostReg to_reg_quotient, HostReg to_reg_remainder, H
to_reg_remainder != Xbyak::Operand::RAX && to_reg_remainder != Xbyak::Operand::RDX)
{
// store to the registers we want.. this could be optimized better
if (to_reg_quotient != HostReg_Count)
if (static_cast<u32>(to_reg_quotient) != HostReg_Count)
m_emit->mov(GetHostReg64(to_reg_quotient), m_emit->rax);
if (to_reg_remainder != HostReg_Count)
if (static_cast<u32>(to_reg_remainder) != HostReg_Count)
m_emit->mov(GetHostReg64(to_reg_remainder), m_emit->rdx);
}
else
{
// store to the registers we want.. this could be optimized better
if (to_reg_quotient != HostReg_Count)
if (static_cast<u32>(to_reg_quotient) != HostReg_Count)
{
m_emit->push(m_emit->rax);
m_emit->pop(GetHostReg64(to_reg_quotient));
}
if (to_reg_remainder != HostReg_Count)
if (static_cast<u32>(to_reg_remainder) != HostReg_Count)
{
m_emit->push(m_emit->rdx);
m_emit->pop(GetHostReg64(to_reg_remainder));

View File

@ -255,8 +255,8 @@ bool HTTPDownloaderWinHttp::StartRequest(HTTPDownloader::Request* request)
BOOL result;
if (req->type == HTTPDownloader::Request::Type::Post)
{
const std::wstring_view additionalHeaders(L"Content-Type: application/x-www-form-urlencoded\r\n");
result = WinHttpSendRequest(req->hRequest, additionalHeaders.data(), additionalHeaders.size(),
const std::wstring_view additional_headers(L"Content-Type: application/x-www-form-urlencoded\r\n");
result = WinHttpSendRequest(req->hRequest, additional_headers.data(), static_cast<DWORD>(additional_headers.size()),
req->post_data.data(), static_cast<DWORD>(req->post_data.size()),
static_cast<DWORD>(req->post_data.size()), reinterpret_cast<DWORD_PTR>(req));
}