1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Enable -Wunused-function warning

This commit is contained in:
Nekotekina 2021-02-15 14:34:10 +03:00
parent 4c1026436f
commit 8e6e57de86
14 changed files with 18 additions and 94 deletions

View File

@ -292,7 +292,7 @@ struct CellNetCtlNatInfo
typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg);
static const char* InfoCodeToName(s32 code)
inline const char* InfoCodeToName(s32 code)
{
switch (code)
{

View File

@ -19,6 +19,10 @@
LOG_CHANNEL(cellSpurs);
#ifndef _MSC_VER
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
//----------------------------------------------------------------------------
// Function prototypes
//----------------------------------------------------------------------------

View File

@ -36,7 +36,7 @@ inline u32 spu_ls_target(u32 pc, u32 imm = 0)
return (pc + (imm << 2)) & 0x3fff0;
}
static u32 spu_decode(u32 inst)
inline u32 spu_decode(u32 inst)
{
return inst >> 21;
}

View File

@ -1250,16 +1250,6 @@ void write_index_array_for_non_indexed_non_native_primitive_to_buffer(char* dst,
namespace
{
/**
* Get first index and index count from a draw indexed clause.
*/
std::tuple<u32, u32> get_first_count_from_draw_indexed_clause(const std::vector<std::pair<u32, u32>>& first_count_arguments)
{
u32 first = std::get<0>(first_count_arguments.front());
u32 count = std::get<0>(first_count_arguments.back()) + std::get<1>(first_count_arguments.back()) - first;
return std::make_tuple(first, count);
}
template<typename T>
std::tuple<T, T, u32> write_index_array_data_to_buffer_impl(gsl::span<T> dst,
gsl::span<const be_t<T>> src,

View File

@ -166,7 +166,7 @@ namespace rsx
}
}
static blit_target_properties get_optimal_blit_target_properties(
static inline blit_target_properties get_optimal_blit_target_properties(
bool src_is_render_target,
address_range dst_range,
u32 dst_pitch,

View File

@ -99,39 +99,6 @@ u8 rsx::internals::get_pixel_size(rsx::surface_depth_format format)
fmt::throw_exception("Unknown depth format");
}
namespace
{
std::array<u32, 4> get_offsets()
{
return{
rsx::method_registers.surface_a_offset(),
rsx::method_registers.surface_b_offset(),
rsx::method_registers.surface_c_offset(),
rsx::method_registers.surface_d_offset(),
};
}
std::array<u32, 4> get_locations()
{
return{
rsx::method_registers.surface_a_dma(),
rsx::method_registers.surface_b_dma(),
rsx::method_registers.surface_c_dma(),
rsx::method_registers.surface_d_dma(),
};
}
std::array<u32, 4> get_pitchs()
{
return{
rsx::method_registers.surface_a_pitch(),
rsx::method_registers.surface_b_pitch(),
rsx::method_registers.surface_c_pitch(),
rsx::method_registers.surface_d_pitch(),
};
}
}
void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool skip_reading)
{
const bool clipped_scissor = (context == rsx::framebuffer_creation_context::context_draw);

View File

@ -964,21 +964,6 @@ namespace rsx
}
}
namespace
{
bool is_int_type(rsx::vertex_base_type type)
{
switch (type)
{
case rsx::vertex_base_type::s32k:
case rsx::vertex_base_type::ub256:
return true;
default:
return false;
}
}
}
std::array<u32, 4> thread::get_color_surface_addresses() const
{
u32 offset_color[] =

View File

@ -249,7 +249,7 @@ namespace vk
rsx::get_location(base_address) == CELL_GCM_LOCATION_LOCAL : // NVIDIA workaround
true;
#else
// Anything running on AMDGPU kernel driver will not work due to the check for fd-backed memory allocations
// Anything running on AMDGPU kernel driver will not work due to the check for fd-backed memory allocations
const bool allow_host_buffers = (vendor != driver_vendor::AMD && vendor != driver_vendor::RADV);
#endif
if (allow_host_buffers && g_render_device->get_external_memory_host_support())
@ -305,8 +305,7 @@ namespace vk
for (auto block = first_block; block <= last_block; block += s_dma_block_length)
{
auto found = g_dma_pool.find(block);
auto &entry = g_dma_pool[block];
auto& entry = g_dma_pool[block];
if (block == first_block)
{

View File

@ -162,25 +162,3 @@ namespace vk
void destroy_pipe_compiler();
pipe_compiler* get_pipe_compiler();
}
namespace rpcs3
{
template <>
usz hash_struct<vk::pipeline_props>(const vk::pipeline_props &pipelineProperties)
{
usz seed = hash_base(pipelineProperties.renderpass_key);
seed ^= hash_struct(pipelineProperties.state.ia);
seed ^= hash_struct(pipelineProperties.state.ds);
seed ^= hash_struct(pipelineProperties.state.rs);
seed ^= hash_struct(pipelineProperties.state.ms);
seed ^= hash_base(pipelineProperties.state.temp_storage.msaa_sample_mask);
// Do not compare pointers to memory!
VkPipelineColorBlendStateCreateInfo tmp;
memcpy(&tmp, &pipelineProperties.state.cs, sizeof(VkPipelineColorBlendStateCreateInfo));
tmp.pAttachments = nullptr;
seed ^= hash_struct(pipelineProperties.state.att_state[0]);
return hash_base(seed);
}
}

View File

@ -43,7 +43,7 @@ namespace input
unsigned int pclass_profile; // See CELL_PAD_PCLASS_PROFILE flags
};
static product_info get_product_info(product_type type)
inline product_info get_product_info(product_type type)
{
switch (type)
{
@ -83,7 +83,7 @@ namespace input
}
}
static std::vector<product_info> get_products_by_class(int class_id)
inline std::vector<product_info> get_products_by_class(int class_id)
{
switch (class_id)
{

View File

@ -34,7 +34,6 @@ else()
add_compile_options(-Werror=return-type)
#TODO Clean the code so these are removed
add_compile_options(-Wno-unused-function)
add_compile_options(-Wno-attributes)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

View File

@ -15,7 +15,8 @@
LOG_CHANNEL(gui_log, "GUI");
constexpr auto qstr = QString::fromStdString;
[[maybe_unused]] constexpr auto qstr = QString::fromStdString;
inline std::string sstr(const QString& _in)
{
return _in.toStdString();

View File

@ -29,7 +29,8 @@ namespace
{
// Helper converters
constexpr auto qstr = QString::fromStdString;
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
[[maybe_unused]] inline std::string sstr(const QString& _in) { return _in.toStdString(); }
QString FormatTimestamp(u64 time)
{

View File

@ -40,11 +40,11 @@ namespace utils
#endif
#ifdef MADV_FREE
constexpr int c_madv_free = MADV_FREE;
[[maybe_unused]] constexpr int c_madv_free = MADV_FREE;
#elif defined(MADV_DONTNEED)
constexpr int c_madv_free = MADV_DONTNEED;
[[maybe_unused]] constexpr int c_madv_free = MADV_DONTNEED;
#else
constexpr int c_madv_free = 0;
[[maybe_unused]] constexpr int c_madv_free = 0;
#endif
#ifdef MADV_HUGEPAGE