diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.h b/rpcs3/Emu/Cell/Modules/cellNetCtl.h index a763fe7ef2..7b4cf807e0 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.h +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.h @@ -292,7 +292,7 @@ struct CellNetCtlNatInfo typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr arg); -static const char* InfoCodeToName(s32 code) +inline const char* InfoCodeToName(s32 code) { switch (code) { diff --git a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp index ca788536eb..c836f33129 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpursSpu.cpp @@ -19,6 +19,10 @@ LOG_CHANNEL(cellSpurs); +#ifndef _MSC_VER +#pragma GCC diagnostic ignored "-Wunused-function" +#endif + //---------------------------------------------------------------------------- // Function prototypes //---------------------------------------------------------------------------- diff --git a/rpcs3/Emu/Cell/SPUOpcodes.h b/rpcs3/Emu/Cell/SPUOpcodes.h index 8e89195e30..efdc68a7f0 100644 --- a/rpcs3/Emu/Cell/SPUOpcodes.h +++ b/rpcs3/Emu/Cell/SPUOpcodes.h @@ -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; } diff --git a/rpcs3/Emu/RSX/Common/BufferUtils.cpp b/rpcs3/Emu/RSX/Common/BufferUtils.cpp index b1b4b26027..b8db764b65 100644 --- a/rpcs3/Emu/RSX/Common/BufferUtils.cpp +++ b/rpcs3/Emu/RSX/Common/BufferUtils.cpp @@ -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 get_first_count_from_draw_indexed_clause(const std::vector>& 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 std::tuple write_index_array_data_to_buffer_impl(gsl::span dst, gsl::span> src, diff --git a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h index f2518f1a63..b744da13e6 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_helpers.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_helpers.h @@ -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, diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index ddaa438219..f606ef61c3 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -99,39 +99,6 @@ u8 rsx::internals::get_pixel_size(rsx::surface_depth_format format) fmt::throw_exception("Unknown depth format"); } -namespace -{ - std::array 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 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 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); diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 1295fb7a08..5d8b3bf3fa 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -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 thread::get_color_surface_addresses() const { u32 offset_color[] = diff --git a/rpcs3/Emu/RSX/VK/VKDMA.cpp b/rpcs3/Emu/RSX/VK/VKDMA.cpp index df2c5b9c5c..b0e46d1d39 100644 --- a/rpcs3/Emu/RSX/VK/VKDMA.cpp +++ b/rpcs3/Emu/RSX/VK/VKDMA.cpp @@ -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) { diff --git a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h index 0c16eda33f..cecb2c1b1b 100644 --- a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h +++ b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.h @@ -162,25 +162,3 @@ namespace vk void destroy_pipe_compiler(); pipe_compiler* get_pipe_compiler(); } - -namespace rpcs3 -{ - template <> - usz hash_struct(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); - } -} diff --git a/rpcs3/Input/product_info.h b/rpcs3/Input/product_info.h index f7b0b2e5a2..7a505532dd 100644 --- a/rpcs3/Input/product_info.h +++ b/rpcs3/Input/product_info.h @@ -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 get_products_by_class(int class_id) + inline std::vector get_products_by_class(int class_id) { switch (class_id) { diff --git a/rpcs3/cmake_modules/ConfigureCompiler.cmake b/rpcs3/cmake_modules/ConfigureCompiler.cmake index 453d3abe98..3c6c6a7f4c 100644 --- a/rpcs3/cmake_modules/ConfigureCompiler.cmake +++ b/rpcs3/cmake_modules/ConfigureCompiler.cmake @@ -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") diff --git a/rpcs3/rpcs3qt/log_viewer.cpp b/rpcs3/rpcs3qt/log_viewer.cpp index 771bbf2f8e..35fa02dbf5 100644 --- a/rpcs3/rpcs3qt/log_viewer.cpp +++ b/rpcs3/rpcs3qt/log_viewer.cpp @@ -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(); diff --git a/rpcs3/rpcs3qt/save_manager_dialog.cpp b/rpcs3/rpcs3qt/save_manager_dialog.cpp index 13a69b2fbe..40a0bd8859 100644 --- a/rpcs3/rpcs3qt/save_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/save_manager_dialog.cpp @@ -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) { diff --git a/rpcs3/util/vm_native.cpp b/rpcs3/util/vm_native.cpp index 49df623ac2..ac6641a68d 100644 --- a/rpcs3/util/vm_native.cpp +++ b/rpcs3/util/vm_native.cpp @@ -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