Frontend: Warning fixes for clang-cl

This commit is contained in:
Stenzek 2022-12-25 15:57:37 +10:00 committed by refractionpcsx2
parent a978abb523
commit 3bb6eb16de
8 changed files with 10 additions and 71 deletions

View File

@ -189,7 +189,6 @@ namespace Achievements
RAPI_STRUCT_NAME(rc_api_submit_lboard_entry_request_t);
RAPI_STRUCT_NAME(rc_api_fetch_leaderboard_info_request_t);
RAPI_STRUCT_NAME(rc_api_response_t);
RAPI_STRUCT_NAME(rc_api_login_response_t);
RAPI_STRUCT_NAME(rc_api_resolve_hash_response_t);
RAPI_STRUCT_NAME(rc_api_fetch_game_data_response_t);
@ -201,6 +200,7 @@ namespace Achievements
RAPI_STRUCT_NAME(rc_api_fetch_leaderboard_info_response_t);
// Unused for now.
// RAPI_STRUCT_NAME(rc_api_response_t);
// RAPI_STRUCT_NAME(rc_api_fetch_achievement_info_response_t);
// RAPI_STRUCT_NAME(rc_api_fetch_games_list_response_t);

View File

@ -63,34 +63,6 @@ private:
bool m_dynamic;
};
static wil::com_ptr_nothrow<ID3D11VertexShader> CreateVertexShader(ID3D11Device* device, const void* bytecode,
size_t bytecode_length)
{
wil::com_ptr_nothrow<ID3D11VertexShader> shader;
const HRESULT hr = device->CreateVertexShader(bytecode, bytecode_length, nullptr, shader.put());
if (FAILED(hr))
{
Console.Error("Failed to create vertex shader: 0x%08X", hr);
return {};
}
return shader;
}
static wil::com_ptr_nothrow<ID3D11PixelShader> CreatePixelShader(ID3D11Device* device, const void* bytecode,
size_t bytecode_length)
{
wil::com_ptr_nothrow<ID3D11PixelShader> shader;
const HRESULT hr = device->CreatePixelShader(bytecode, bytecode_length, nullptr, shader.put());
if (FAILED(hr))
{
Console.Error("Failed to create pixel shader: 0x%08X", hr);
return {};
}
return shader;
}
D3D11HostDisplay::D3D11HostDisplay() = default;
D3D11HostDisplay::~D3D11HostDisplay()

View File

@ -16,6 +16,7 @@
#pragma once
#include "HostDisplay.h"
#include "common/RedtapeWindows.h"
#include "common/RedtapeWilCom.h"
#include "common/WindowInfo.h"
#include <array>
#include <d3d11.h>
@ -24,7 +25,6 @@
#include <string>
#include <string_view>
#include <vector>
#include <wil/com.h>
class D3D11HostDisplay final : public HostDisplay
{

View File

@ -16,13 +16,13 @@
#pragma once
#define DIRECTINPUT_VERSION 0x0800
#include "common/RedtapeWindows.h"
#include "common/RedtapeWilCom.h"
#include "Frontend/InputSource.h"
#include <array>
#include <dinput.h>
#include <functional>
#include <mutex>
#include <vector>
#include <wil/com.h>
class DInputSource final : public InputSource
{

View File

@ -330,9 +330,12 @@ namespace FullscreenUI
static void DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section, const char* key,
int default_value, int min_value, int max_value, int step_value, const char* format = "%d", bool enabled = true,
float height = ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT, ImFont* font = g_large_font, ImFont* summary_font = g_medium_font);
#if 0
// Unused as of now
static void DrawFloatRangeSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section, const char* key,
float default_value, float min_value, float max_value, const char* format = "%f", float multiplier = 1.0f, bool enabled = true,
float height = ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT, ImFont* font = g_large_font, ImFont* summary_font = g_medium_font);
#endif
static void DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section,
const char* key, float default_value, float min_value, float max_value, float step_value, float multiplier,
const char* format = "%f", bool enabled = true, float height = ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT,
@ -434,8 +437,6 @@ namespace FullscreenUI
static HostDisplayTexture* GetTextureForGameListEntryType(GameList::EntryType type);
static HostDisplayTexture* GetGameListCover(const GameList::Entry* entry);
static HostDisplayTexture* GetCoverForCurrentGame();
static std::string GetNotificationImageForGame(const GameList::Entry* entry);
static std::string GetNotificationImageForGame(const std::string& game_path);
// Lazily populated cover images.
static std::unordered_map<std::string, std::string> s_cover_image_map;
@ -1654,6 +1655,8 @@ void FullscreenUI::DrawIntSpinBoxSetting(SettingsInterface* bsi, const char* tit
ImGui::PopFont();
}
#if 0
// Unused as of now
void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section,
const char* key, float default_value, float min_value, float max_value, const char* format, float multiplier, bool enabled,
float height, ImFont* font, ImFont* summary_font)
@ -1710,6 +1713,7 @@ void FullscreenUI::DrawFloatRangeSetting(SettingsInterface* bsi, const char* tit
ImGui::PopStyleVar(4);
ImGui::PopFont();
}
#endif
void FullscreenUI::DrawFloatSpinBoxSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section,
const char* key, float default_value, float min_value, float max_value, float step_value, float multiplier, const char* format,
@ -3932,7 +3936,6 @@ void FullscreenUI::DrawControllerSettingsPage()
ImGui::PopID();
}
static constexpr const char* usb_sections[USB::NUM_PORTS] = {"USB1", "USB2"};
for (u32 port = 0; port < USB::NUM_PORTS; port++)
{
ImGui::PushID(port);
@ -4680,7 +4683,6 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
(static_cast<float>(ImGui::GetWindowWidth()) - (item_width_with_spacing * static_cast<float>(grid_count_x))) * 0.5f;
u32 grid_x = 0;
u32 grid_y = 0;
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
for (u32 i = 0; i < s_save_state_selector_slots.size(); i++)
{
@ -4869,7 +4871,6 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
if (grid_x == grid_count_x)
{
grid_x = 0;
grid_y++;
ImGui::SetCursorPosX(start_x);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
}
@ -5388,7 +5389,6 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
std::string draw_title;
u32 grid_x = 0;
u32 grid_y = 0;
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
for (const GameList::Entry* entry : s_game_list_sorted_entries)
{
@ -5451,7 +5451,6 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
if (grid_x == grid_count_x)
{
grid_x = 0;
grid_y++;
ImGui::SetCursorPosX(start_x);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
}
@ -5786,23 +5785,6 @@ HostDisplayTexture* FullscreenUI::GetCoverForCurrentGame()
return GetGameListCover(entry);
}
std::string FullscreenUI::GetNotificationImageForGame(const GameList::Entry* entry)
{
std::string ret;
if (entry)
ret = GameList::GetCoverImagePathForEntry(entry);
return ret;
}
std::string FullscreenUI::GetNotificationImageForGame(const std::string& game_path)
{
auto lock = GameList::GetLock();
const GameList::Entry* entry = GameList::GetEntryForPath(game_path.c_str());
return entry ? GetNotificationImageForGame(entry) : std::string();
}
//////////////////////////////////////////////////////////////////////////
// Overlays
//////////////////////////////////////////////////////////////////////////

View File

@ -67,8 +67,6 @@ namespace GameList
static bool IsScannableFilename(const std::string_view& path);
static Entry* GetMutableEntryForPath(const char* path);
static bool GetIsoSerialAndCRC(const std::string& path, s32* disc_type, std::string* serial, u32* crc);
static Region ParseDatabaseRegion(const std::string_view& db_region);
static bool GetElfListEntry(const std::string& path, GameList::Entry* entry);
@ -739,18 +737,6 @@ const GameList::Entry* GameList::GetEntryBySerialAndCRC(const std::string_view&
return nullptr;
}
GameList::Entry* GameList::GetMutableEntryForPath(const char* path)
{
const size_t path_length = std::strlen(path);
for (Entry& entry : s_entries)
{
if (entry.path.size() == path_length && StringUtil::Strcasecmp(entry.path.c_str(), path) == 0)
return &entry;
}
return nullptr;
}
u32 GameList::GetEntryCount()
{
return static_cast<u32>(s_entries.size());

View File

@ -105,7 +105,7 @@ bool XInputSource::Initialize(SettingsInterface& si, std::unique_lock<std::mutex
// Try the hidden version of XInputGetState(), which lets us query the guide button.
m_xinput_get_state = reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, reinterpret_cast<LPCSTR>(100)));
if (!m_xinput_get_state)
reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, "XInputGetState"));
m_xinput_get_state = reinterpret_cast<decltype(m_xinput_get_state)>(GetProcAddress(m_xinput_module, "XInputGetState"));
m_xinput_set_state = reinterpret_cast<decltype(m_xinput_set_state)>(GetProcAddress(m_xinput_module, "XInputSetState"));
m_xinput_get_capabilities =
reinterpret_cast<decltype(m_xinput_get_capabilities)>(GetProcAddress(m_xinput_module, "XInputGetCapabilities"));

View File

@ -117,7 +117,6 @@ static void ImGui_ImplDX12_SetupRenderState(ImDrawData* draw_data, ID3D12Graphic
// Bind shader and vertex buffers
unsigned int stride = sizeof(ImDrawVert);
unsigned int offset = 0;
D3D12_VERTEX_BUFFER_VIEW vbv;
memset(&vbv, 0, sizeof(D3D12_VERTEX_BUFFER_VIEW));
vbv.BufferLocation = bd->VertexStreamBuffer.GetCurrentGPUPointer();