Misc: Unreachable code warning fixes

This commit is contained in:
Stenzek 2023-09-05 21:13:14 +10:00
parent be71fb6000
commit adc124c759
13 changed files with 0 additions and 23 deletions

View file

@ -12,7 +12,6 @@ LayeredSettingsInterface::~LayeredSettingsInterface() = default;
bool LayeredSettingsInterface::Save()
{
Panic("Attempting to save layered settings interface");
return false;
}
void LayeredSettingsInterface::Clear()
@ -183,13 +182,11 @@ void LayeredSettingsInterface::SetStringList(const char* section, const char* ke
bool LayeredSettingsInterface::RemoveFromStringList(const char* section, const char* key, const char* item)
{
Panic("Attempt to call RemoveFromStringList() on layered settings interface");
return false;
}
bool LayeredSettingsInterface::AddToStringList(const char* section, const char* key, const char* item)
{
Panic("Attempt to call AddToStringList() on layered settings interface");
return true;
}
std::vector<std::pair<std::string, std::string>> LayeredSettingsInterface::GetKeyValueList(const char* section) const

View file

@ -879,7 +879,6 @@ u8 CDROM::ReadRegister(u32 offset)
Log_ErrorPrintf("Unknown CDROM register read: offset=0x%02X, index=%d", offset,
ZeroExtend32(s_status.index.GetValue()));
Panic("Unknown CDROM register");
return 0;
}
void CDROM::WriteRegister(u32 offset, u8 value)

View file

@ -274,7 +274,6 @@ Value CodeGenerator::ConvertValueSize(const Value& value, RegSize size, bool sig
}
UnreachableCode();
return Value{};
}
Value new_value = m_register_cache.AllocateScratch(size);
@ -330,7 +329,6 @@ void* CodeGenerator::GetCurrentCodePointer() const
return GetCurrentFarCodePointer();
Panic("unknown emitter");
return nullptr;
}
Value CodeGenerator::AddValues(const Value& lhs, const Value& rhs, bool set_flags)
@ -2480,7 +2478,6 @@ bool CodeGenerator::Compile_Branch(const CodeBlockInstruction& cbi)
else
{
UnreachableCode();
return false;
}
}
@ -2549,7 +2546,6 @@ bool CodeGenerator::Compile_Branch(const CodeBlockInstruction& cbi)
default:
UnreachableCode();
return false;
}
}

View file

@ -133,10 +133,7 @@ bool DigitalController::Transfer(const u8 data_in, u8* data_out)
return false;
default:
{
UnreachableCode();
return false;
}
}
}

View file

@ -1356,7 +1356,6 @@ InstructionImpl GetInstructionImpl(u32 inst_bits, TickCount* ticks)
default:
Panic("Missing handler");
return nullptr;
}
}

View file

@ -175,10 +175,7 @@ bool GunCon::Transfer(const u8 data_in, u8* data_out)
}
default:
{
UnreachableCode();
return false;
}
}
}

View file

@ -154,7 +154,6 @@ bool PlayStationMouse::Transfer(const u8 data_in, u8* data_out)
default:
{
UnreachableCode();
return false;
}
}
}

View file

@ -89,7 +89,6 @@ D3D11StreamBuffer::MappingResult D3D11StreamBuffer::Map(ID3D11DeviceContext1* co
Log_ErrorPrintf("Map failed: 0x%08X (alignment %u, minsize %u, size %u, position %u, map type %u)", hr, alignment,
min_size, m_size, m_position, static_cast<u32>(map_type));
Panic("Map failed");
return {};
}
return MappingResult{static_cast<char*>(sr.pData) + m_position, m_position, m_position / alignment,

View file

@ -2087,7 +2087,6 @@ bool D3D12Device::UpdateRootParameters(u32 dirty)
default:
UnreachableCode();
return false;
}
}

View file

@ -71,7 +71,6 @@ bool D3D12StreamBuffer::ReserveMemory(u32 num_bytes, u32 alignment)
Log_ErrorPrintf("Attempting to allocate %u bytes from a %u byte stream buffer", static_cast<u32>(num_bytes),
static_cast<u32>(m_size));
Panic("Stream buffer overflow");
return false;
}
// Is the GPU behind or up to date with our current offset?

View file

@ -160,7 +160,6 @@ static GPUSampler::Config MapSampler(const reshadefx::sampler_info& si)
return GPUSampler::AddressMode::Repeat;
case reshadefx::texture_address_mode::mirror:
Panic("Not implemented");
return GPUSampler::AddressMode::Repeat;
case reshadefx::texture_address_mode::clamp:
return GPUSampler::AddressMode::ClampToEdge;
case reshadefx::texture_address_mode::border:
@ -241,7 +240,6 @@ static GPUPipeline::Primitive MapPrimitive(reshadefx::primitive_topology topolog
return GPUPipeline::Primitive::Lines;
case reshadefx::primitive_topology::line_strip:
Panic("Unhandled line strip");
return GPUPipeline::Primitive::Lines;
case reshadefx::primitive_topology::triangle_list:
return GPUPipeline::Primitive::Triangles;
case reshadefx::primitive_topology::triangle_strip:

View file

@ -3169,7 +3169,6 @@ bool VulkanDevice::UpdateDescriptorSets(u32 dirty)
default:
UnreachableCode();
return false;
}
}

View file

@ -119,7 +119,6 @@ bool VulkanStreamBuffer::ReserveMemory(u32 num_bytes, u32 alignment)
Log_ErrorPrintf("Attempting to allocate %u bytes from a %u byte stream buffer", static_cast<u32>(num_bytes),
static_cast<u32>(m_size));
Panic("Stream buffer overflow");
return false;
}
UpdateGPUPosition();