Fix a bunch of compiler warnings

This commit is contained in:
Connor McLaughlin 2020-07-09 13:29:58 +10:00
parent 60a739e305
commit a5fe740e30
11 changed files with 15 additions and 19 deletions

View file

@ -684,8 +684,6 @@ bool Context::CreateCommandBuffers()
void Context::DestroyCommandBuffers()
{
VkDevice device = m_device;
for (FrameResources& resources : m_frame_resources)
{
for (auto& it : resources.cleanup_resources)

View file

@ -75,7 +75,7 @@ static void DestroyMetalLayer(WindowInfo& wi)
namespace Vulkan {
SwapChain::SwapChain(const WindowInfo& wi, VkSurfaceKHR surface, bool vsync)
: m_wi(wi), m_surface(surface), m_vsync_enabled(vsync)
: m_wi(wi), m_vsync_enabled(vsync), m_surface(surface)
{
}

View file

@ -839,7 +839,7 @@ void GPU_HW_OpenGL::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void*
// update texture data
glTexSubImage2D(GL_TEXTURE_2D, 0, x, flipped_y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
reinterpret_cast<void*>(map_result.buffer_offset));
reinterpret_cast<void*>(static_cast<uintptr_t>(map_result.buffer_offset)));
m_texture_stream_buffer->Unbind();
if (m_resolution_scale > 1)

View file

@ -411,9 +411,10 @@ void Core::MulMatVecBuggy(const s16 M[3][3], const s32 T[3], const s16 Vx, const
#define dot3(i) \
do \
{ \
TruncateAndSetIR<i + 1>( \
SignExtendMACResult<i + 1>(SignExtendMACResult<i + 1>((s64(T[i]) << 12) + (s64(M[i][0]) * s64(Vx)))) >> shift, \
false); \
TruncateAndSetIR<i + 1>(static_cast<s32>(SignExtendMACResult<i + 1>(SignExtendMACResult<i + 1>( \
(s64(T[i]) << 12) + (s64(M[i][0]) * s64(Vx)))) >> \
shift), \
false); \
TruncateAndSetMACAndIR<i + 1>(SignExtendMACResult<i + 1>((s64(M[i][1]) * s64(Vy))) + (s64(M[i][2]) * s64(Vz)), \
shift, lm); \
} while (0)

View file

@ -1,6 +1,5 @@
#include "namco_guncon.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/state_wrapper.h"
#include "gpu.h"
#include "host_display.h"
@ -8,7 +7,6 @@
#include "resources.h"
#include "system.h"
#include <array>
Log_SetChannel(NamcoGunCon);
NamcoGunCon::NamcoGunCon(System* system) : m_system(system) {}

View file

@ -1477,7 +1477,6 @@ std::tuple<s32, s32> SPU::SampleVoice(u32 voice_index)
if (IsPitchModulationEnabled(voice_index))
{
const s32 factor = std::clamp<s32>(m_voices[voice_index - 1].last_volume, -0x8000, 0x7FFF) + 0x8000;
const u16 old_step = step;
step = Truncate16(static_cast<u32>((SignExtend32(step) * factor) >> 15));
}
step = std::min<u16>(step, 0x3FFF);

View file

@ -867,9 +867,9 @@ void System::UpdateMemoryCards()
{
m_pad->SetMemoryCard(i, nullptr);
const MemoryCardType type = settings.memory_card_types[i];
std::unique_ptr<MemoryCard> card;
switch (settings.memory_card_types[i])
const MemoryCardType type = settings.memory_card_types[i];
switch (type)
{
case MemoryCardType::None:
continue;

View file

@ -18,7 +18,7 @@ public:
RenderAPI GetRenderAPI() const override;
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device) override;
void DestroyRenderDevice();
void DestroyRenderDevice() override;
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;

View file

@ -45,7 +45,7 @@ void QtProgressCallback::SetProgressValue(u32 value)
{
BaseProgressCallback::SetProgressValue(value);
if (m_dialog.value() == m_progress_range)
if (static_cast<u32>(m_dialog.value()) == m_progress_range)
return;
m_dialog.setValue(m_progress_value);

View file

@ -491,7 +491,7 @@ bool CommonHostInterface::ResumeSystemFromState(const char* filename, bool boot_
return false;
const bool global = m_system->GetRunningCode().empty();
if (m_system->GetRunningCode().empty())
if (global)
{
ReportFormattedError("Cannot resume system with undetectable game code from '%s'.", filename);
if (!boot_on_failure)

View file

@ -248,16 +248,16 @@ protected:
void CheckSettings(SettingsInterface& si);
/// Restores all settings to defaults.
virtual void SetDefaultSettings(SettingsInterface& si);
virtual void SetDefaultSettings(SettingsInterface& si) override;
/// Loads settings to m_settings and any frontend-specific parameters.
virtual void LoadSettings(SettingsInterface& si);
virtual void LoadSettings(SettingsInterface& si) override;
/// Saves current settings variables to ini.
virtual void SaveSettings(SettingsInterface& si);
virtual void SaveSettings(SettingsInterface& si) override;
/// Checks for settings changes, std::move() the old settings away for comparing beforehand.
virtual void CheckForSettingsChanges(const Settings& old_settings);
virtual void CheckForSettingsChanges(const Settings& old_settings) override;
/// Increases timer resolution when supported by the host OS.
void SetTimerResolutionIncreased(bool enabled);