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); 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) switch (code)
{ {

View file

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

View file

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

View file

@ -1250,16 +1250,6 @@ void write_index_array_for_non_indexed_non_native_primitive_to_buffer(char* dst,
namespace 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> template<typename T>
std::tuple<T, T, u32> write_index_array_data_to_buffer_impl(gsl::span<T> dst, std::tuple<T, T, u32> write_index_array_data_to_buffer_impl(gsl::span<T> dst,
gsl::span<const be_t<T>> src, 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, bool src_is_render_target,
address_range dst_range, address_range dst_range,
u32 dst_pitch, 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"); 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) void GLGSRender::init_buffers(rsx::framebuffer_creation_context context, bool skip_reading)
{ {
const bool clipped_scissor = (context == rsx::framebuffer_creation_context::context_draw); 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 std::array<u32, 4> thread::get_color_surface_addresses() const
{ {
u32 offset_color[] = u32 offset_color[] =

View file

@ -305,7 +305,6 @@ namespace vk
for (auto block = first_block; block <= last_block; block += s_dma_block_length) 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) if (block == first_block)

View file

@ -162,25 +162,3 @@ namespace vk
void destroy_pipe_compiler(); void destroy_pipe_compiler();
pipe_compiler* get_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 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) 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) switch (class_id)
{ {

View file

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

View file

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

View file

@ -29,7 +29,8 @@ namespace
{ {
// Helper converters // Helper converters
constexpr auto qstr = QString::fromStdString; 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) QString FormatTimestamp(u64 time)
{ {

View file

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