Misc: More warning fixes

This commit is contained in:
Connor McLaughlin 2022-08-10 14:33:20 +10:00
parent 0f198cbe3a
commit 916900be5d
11 changed files with 18 additions and 18 deletions

View File

@ -24,9 +24,7 @@
// unreferenced parameter macro
#ifndef UNREFERENCED_VARIABLE
#if defined(_MSC_VER)
#define UNREFERENCED_VARIABLE(P) (P)
#elif defined(__GNUC__) || defined(__clang__) || defined(__EMSCRIPTEN__)
#if defined(__GNUC__) || defined(__clang__) || defined(__EMSCRIPTEN__)
#define UNREFERENCED_VARIABLE(P) (void)(P)
#else
#define UNREFERENCED_VARIABLE(P) (P)

View File

@ -24,7 +24,7 @@ public:
CDROMAsyncReader();
~CDROMAsyncReader();
const CDImage::LBA GetLastReadSector() const { return m_buffers[m_buffer_front.load()].lba; }
CDImage::LBA GetLastReadSector() const { return m_buffers[m_buffer_front.load()].lba; }
const SectorBuffer& GetSectorBuffer() const { return m_buffers[m_buffer_front.load()].data; }
const CDImage::SubChannelQ& GetSectorSubQ() const { return m_buffers[m_buffer_front.load()].subq; }
u32 GetBufferedSectorCount() const { return m_buffer_count.load(); }

View File

@ -94,10 +94,10 @@ struct CodeBlock
u32 recompile_count = 0;
u32 invalidate_frame_number = 0;
const u32 GetPC() const { return key.GetPC(); }
const u32 GetSizeInBytes() const { return static_cast<u32>(instructions.size()) * sizeof(Instruction); }
const u32 GetStartPageIndex() const { return (key.GetPCPhysicalAddress() / HOST_PAGE_SIZE); }
const u32 GetEndPageIndex() const { return ((key.GetPCPhysicalAddress() + GetSizeInBytes()) / HOST_PAGE_SIZE); }
u32 GetPC() const { return key.GetPC(); }
u32 GetSizeInBytes() const { return static_cast<u32>(instructions.size()) * sizeof(Instruction); }
u32 GetStartPageIndex() const { return (key.GetPCPhysicalAddress() / HOST_PAGE_SIZE); }
u32 GetEndPageIndex() const { return ((key.GetPCPhysicalAddress() + GetSizeInBytes()) / HOST_PAGE_SIZE); }
bool IsInRAM() const
{
// TODO: Constant

View File

@ -317,9 +317,11 @@ void CodeGenerator::EmitSignExtend(HostReg to_reg, RegSize to_size, HostReg from
}
}
break;
}
Panic("Unknown sign-extend combination");
default:
Panic("Unknown sign-extend combination");
break;
}
}
void CodeGenerator::EmitZeroExtend(HostReg to_reg, RegSize to_size, HostReg from_reg, RegSize from_size)

View File

@ -33,7 +33,7 @@ public:
GPU_HW();
virtual ~GPU_HW();
const Threading::Thread* GetSWThread() const;
const Threading::Thread* GetSWThread() const override;
virtual bool Initialize() override;
virtual void Reset(bool clear_vram) override;

View File

@ -798,7 +798,7 @@ void GPU_HW_Vulkan::ClearFramebuffer()
m_vram_depth_texture.TransitionToLayout(cmdbuf, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
static constexpr VkClearColorValue cc = {};
const VkClearDepthStencilValue cds = {m_pgxp_depth_buffer ? 1.0f : 0.0f};
const VkClearDepthStencilValue cds = {m_pgxp_depth_buffer ? 1.0f : 0.0f, 0u};
static constexpr VkImageSubresourceRange csrr = {VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u};
static constexpr VkImageSubresourceRange dsrr = {VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 1u, 0u, 1u};
vkCmdClearColorImage(cmdbuf, m_vram_texture.GetImage(), m_vram_texture.GetLayout(), &cc, 1u, &csrr);

View File

@ -23,7 +23,7 @@ public:
ALWAYS_INLINE const GPU_SW_Backend& GetBackend() const { return m_backend; }
GPURenderer GetRendererType() const override;
const Threading::Thread* GetSWThread() const;
const Threading::Thread* GetSWThread() const override;
bool Initialize() override;
bool DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool update_display) override;

View File

@ -552,7 +552,7 @@ void CheatManagerDialog::addCodeClicked()
group_item->setExpanded(true);
Host::RunOnCPUThread(
[this, &new_code]() {
[&new_code]() {
System::GetCheatList()->AddCode(std::move(new_code));
System::SaveCheatList();
},

View File

@ -86,8 +86,8 @@ protected:
virtual bool CreateResources() override;
virtual void DestroyResources() override;
virtual bool CreateImGuiContext();
virtual void DestroyImGuiContext();
virtual bool CreateImGuiContext() override;
virtual void DestroyImGuiContext() override;
virtual bool UpdateImGuiFontTexture() override;
bool CreateSwapChain(const DXGI_MODE_DESC* fullscreen_mode);

View File

@ -12,7 +12,7 @@ public:
~PostProcessingChain();
ALWAYS_INLINE bool IsEmpty() const { return m_shaders.empty(); }
ALWAYS_INLINE const u32 GetStageCount() const { return static_cast<u32>(m_shaders.size()); }
ALWAYS_INLINE u32 GetStageCount() const { return static_cast<u32>(m_shaders.size()); }
ALWAYS_INLINE const PostProcessingShader& GetShaderStage(u32 i) const { return m_shaders[i]; }
ALWAYS_INLINE PostProcessingShader& GetShaderStage(u32 i) { return m_shaders[i]; }

View File

@ -4,7 +4,7 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);SOUNDTOUCH_FLOAT_SAMPLES;SOUNDTOUCH_ALLOW_SSE</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);SOUNDTOUCH_FLOAT_SAMPLES;SOUNDTOUCH_ALLOW_SSE;ST_NO_EXCEPTION_HANDLING=1</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='ARM64'">%(PreprocessorDefinitions);SOUNDTOUCH_USE_NEON</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)dep\soundtouch\include;$(SolutionDir)dep\simpleini\include;$(SolutionDir)dep\libchdr\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>